Skip to content

Commit

Permalink
Add automation job to update infra repository
Browse files Browse the repository at this point in the history
This job will send a repository dispatch event to
the infrastructure repository when a new app version
is ready for release.
  • Loading branch information
okiedork authored and flavioheleno committed May 1, 2022
1 parent 6a56f91 commit 9448f90
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,27 @@ jobs:
tag_name: "${{ steps.prepare-build.outputs.environment }}@${{ steps.prepare-build.outputs.short }}"
target_commitish: ${{ github.sha }}
generate_release_notes: true

update-infra:
needs: docker
runs-on: ubuntu-latest

steps:

- name: Set up variables
id: repo-vars
run: |
if [[ "${{ github.ref_name }}" == "main" ]]; then
echo "::set-output name=environment::prod"
else
echo "::set-output name=environment::dev"
fi
- name: Send update to infrastructure repository
uses: peter-evans/repository-dispatch@11ba7d3f32dc7cc919d1c43f1fec1c05260c26b5
# the token is a personal access token with "repo" scope
with:
token: ${{ secrets.INFRA_REPO_ACCESS_TOKEN }}
repository: package-health/infra-service
event-type: deploy-new-version
client-payload: '{"sha": "${{ github.sha }}", "environment": "${{ steps.repo-vars.outputs.environment }}"}'

0 comments on commit 9448f90

Please sign in to comment.