Skip to content

ArgoCD

ArgoCD #5

Workflow file for this run

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'