ArgoCD #5
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: ArgoCD | |
on: | |
workflow_run: | |
workflows: ["Build Multi-arch Containers and Push"] | |
types: [completed] | |
jobs: | |
update-argocd-deployment: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Replace image in ArgoCD deployment | |
run: | | |
sed -i 's|image:.*|image: ghcr.io/${{ github.repository_owner }}/my-app:${{ github.sha }}|' argocd/deployment.yml | |
- name: Commit and push changes | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
git add argocd/deployment.yml | |
git commit -m "Update image reference" | |
git push | |
on-failure: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
steps: | |
- run: echo 'The triggering workflow failed' |