From 1b9376ce72464b75b6817d758f43cac1769428cd Mon Sep 17 00:00:00 2001 From: Harris Tzovanakis Date: Thu, 27 Jul 2023 14:20:27 +0200 Subject: [PATCH] gh-action: fix release --- .github/workflows/backend-tests-on-docker.yml | 16 +--------------- .github/workflows/push-master.yml | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/backend-tests-on-docker.yml b/.github/workflows/backend-tests-on-docker.yml index b10e8b831d..1a4099dfc1 100644 --- a/.github/workflows/backend-tests-on-docker.yml +++ b/.github/workflows/backend-tests-on-docker.yml @@ -11,10 +11,6 @@ on: tag: description: The id of the image that has been buit value: ${{ jobs.Release.outputs.tag }} - type: - description: The event-type of the release - value: ${{ jobs.Release.outputs.type }} - jobs: Build: runs-on: ubuntu-latest @@ -207,16 +203,6 @@ jobs: echo "RELEASE=$(git tag --points-at HEAD)" >> $GITHUB_ENV echo "TAG=${RELEASE:-$(git describe --always --tags)}" >> $GITHUB_ENV echo "tag=${RELEASE:-$(git describe --always --tags)}" >> $GITHUB_OUTPUT - - if [[ "${{ github.event_name }}" == "release" ]]; then - echo "Event type is release" - echo "type=release" >> $GITHUB_OUTPUT - echo "TYPE=release" >> $GITHUB_ENV - else - echo "Event type is update" - echo "type=update" >> $GITHUB_OUTPUT - echo "TYPE=update" >> $GITHUB_ENV - fi - name: deploy docker images id: deploy-docker-images shell: bash @@ -224,4 +210,4 @@ jobs: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} INSPIRE_BOT_TOKEN: ${{ secrets.INSPIRE_BOT_TOKEN }} - run: ./deploy-docker-image.sh $TAG $RELEASE $TYPE + run: ./deploy-docker-image.sh $TAG $RELEASE diff --git a/.github/workflows/push-master.yml b/.github/workflows/push-master.yml index 4ab42a7579..7bcba883a0 100644 --- a/.github/workflows/push-master.yml +++ b/.github/workflows/push-master.yml @@ -21,13 +21,24 @@ jobs: needs: test runs-on: ubuntu-latest steps: - - name: send event + - name: send event (release) + if : ${{ github.event_name == 'release' }} uses: cern-sis/gh-workflows/.github/actions/kubernetes-project-new-images@v5.6.0 with: - event-type: ${{ needs.test.outputs.type }} + event-type: release images: | inspirehep/next@${{ needs.test.outputs.tag }} inspirehep/next-assets@${{ needs.test.outputs.tag }} inspirehep/next-scrapyd@${{ needs.test.outputs.tag }} token: ${{ secrets.PAT_FIRE_EVENTS_ON_CERN_SIS_KUBERNETES }} + - name: send event (update) + if : ${{ github.event_name != 'release' }} + uses: cern-sis/gh-workflows/.github/actions/kubernetes-project-new-images@v5.6.0 + with: + event-type: update + images: | + inspirehep/next@${{ needs.test.outputs.tag }} + inspirehep/next-assets@${{ needs.test.outputs.tag }} + inspirehep/next-scrapyd@${{ needs.test.outputs.tag }} + token: ${{ secrets.PAT_FIRE_EVENTS_ON_CERN_SIS_KUBERNETES }}