-
Notifications
You must be signed in to change notification settings - Fork 2
35 lines (33 loc) · 1.22 KB
/
argocd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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: Creat image name
run: |
repo_name=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "REPO_NAME=$repo_name" >> "$GITHUB_ENV"
- name: Replace image value in ArgoCD
run: |
echo "REPO_NAME=$REPO_NAME"
sed -i 's|image:.*|image: ghcr.io/${{ env.REPO_NAME }}:${{ vars.IMAGE_TAG }}|' argocd/deployment.yml
- name: Commit and push changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git status
git add argocd/deployment.yml
git commit -m "Update image reference for ArgoCD"
git push
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'The triggering workflow failed'