Skip to content

Commit

Permalink
Update the WF with the same template than scoap3 hepcrawl
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-bergia committed Apr 18, 2023
1 parent 96d9427 commit b05f1ac
Showing 1 changed file with 14 additions and 42 deletions.
56 changes: 14 additions & 42 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,55 +22,27 @@ jobs:
run: |
docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm tests
docker:
runs-on: ubuntu-latest
needs: tests
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
id: build
uses: cern-sis/gh-workflows/.github/actions/[email protected]
with:
push: true
tags: scoap3/scoap3:latest,scoap3/scoap3:${{ github.sha }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
image: scoap3/scoap3
username: scoap3
password: ${{ secrets.DOCKERHUB_PASSWORD }}
cache: false

- name: Deploy QA
uses: peter-evans/repository-dispatch@v1
if: ${{ github.event_name == 'push'}}
uses: cern-sis/gh-workflows/.github/actions/[email protected]
with:
token: ${{ secrets.INSPIRE_BOT_TOKEN }}
repository: cern-sis/kubernetes
event-type: deploy
client-payload: '{"project": "scoap3", "application": "scoap3", "namespace": "scoap3-qa","image":"scoap3/scoap3","new_tag":"${{ github.sha }}"}'

- name: Build and push PROD
id: docker_build_prod
if: ${{ github.event_name == 'release'}}
uses: docker/build-push-action@v2
with:
push: true
tags: scoap3/scoap3:${{ github.ref_name }}
event-type: update
images: ${{ steps.build.outputs.image-tags }}
token: ${{ secrets.PAT_FIRE_EVENTS_ON_CERN_SIS_KUBERNETES }}

- name: Deploy PROD
uses: peter-evans/repository-dispatch@v1
if: ${{ github.event_name == 'release'}}
uses: cern-sis/gh-workflows/.github/actions/[email protected]
with:
token: ${{ secrets.INSPIRE_BOT_TOKEN }}
repository: cern-sis/kubernetes
event-type: deploy
client-payload: '{"project": "scoap3", "application": "scoap3", "namespace": "scoap3-prod","image":"scoap3/scoap3","new_tag":"${{ github.ref_name }}"}'

event-type: release
images: ${{ steps.build.outputs.image-tags }}
token: ${{ secrets.PAT_FIRE_EVENTS_ON_CERN_SIS_KUBERNETES }}

0 comments on commit b05f1ac

Please sign in to comment.