Merge pull request #99 from digio-ch/issue/hc-235 #50
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: stage | |
on: | |
push: | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" | |
env: | |
DOCKER_REGISTRY_URL: https://docker.pkg.github.com | |
DOCKER_REGISTRY_PATH: docker.pkg.github.com/digio-ch/pbs-healthcheck-core/healthcheck-core | |
jobs: | |
build-stage: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to github docker packages registry | |
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login -u ${{ github.actor }} $DOCKER_REGISTRY_URL --password-stdin | |
- name: Build, tag and push stage/rc image | |
run: | | |
docker build -f docker/Dockerfile -t $DOCKER_REGISTRY_PATH:${GITHUB_REF#refs/*/} . | |
docker push $DOCKER_REGISTRY_PATH:${GITHUB_REF#refs/*/} | |
docker tag $DOCKER_REGISTRY_PATH:${GITHUB_REF#refs/*/} $DOCKER_REGISTRY_PATH:stage | |
docker push $DOCKER_REGISTRY_PATH:stage | |
dispatch_deploy: | |
needs: [build-stage] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Trigger Deployment | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.PAT_HC_DISPATCH }} | |
repository: digio-ch/pbs-healthcheck-config | |
event-type: deploy | |
client-payload: '{ "ref": "${{ github.ref }}", "app_env": "stage", "target_server": "stage" }' |