Skip to content

Commit

Permalink
gh-action: fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
drjova committed Jul 27, 2023
1 parent 69477d9 commit 1b9376c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
16 changes: 1 addition & 15 deletions .github/workflows/backend-tests-on-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -207,21 +203,11 @@ 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
env:
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
15 changes: 13 additions & 2 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
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 }}

0 comments on commit 1b9376c

Please sign in to comment.