-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
63 lines (57 loc) · 1.95 KB
/
action.yaml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Argo CD App Update on Release
description: Action to update an argo cd app manifest when a release is made in the source code
inputs:
pat:
description: PAT for accessing the application repo
required: true
cluster:
description: Name of the cluster to deploy to
required: true
app-name:
description: Name of the application to deploy
required: true
target-revision:
description: Release tag of the application to deploy
required: false
image-tag:
description: Image tag to use for the application
required: false
runs:
using: composite
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: beezlabs-org/k8s-landscape-apps
token: ${{ inputs.pat }}
- name: Set Target Revision
if: inputs.target-revision
run: |
yq -i '.${{ inputs.cluster }}.${{ inputs.app-name }}.targetRevision = "${{ inputs.target-revision }}"' './app-of-apps/values.yaml'
shell: bash
- name: Set Release Id
if: inputs.target-revision
run: |
echo "RELEASE_ID=${{ inputs.target-revision }}" >> $GITHUB_ENV
shell: bash
- name: Set Target Revision
if: inputs.image-tag
run: |
yq -i '.${{ inputs.cluster }}.${{ inputs.app-name }}.imageTag = "${{ inputs.image-tag }}"' './app-of-apps/values.yaml'
shell: bash
- name: Set Release Id
if: inputs.target-revision
run: |
echo "RELEASE_ID=${{ inputs.image-tag }}" >> $GITHUB_ENV
shell: bash
- name: Commit Changes
env:
GIT_AUTHOR_NAME: Beez Innovation Labs
GIT_COMMITTER_NAME: Beez Innovation Labs
GIT_AUTHOR_EMAIL: github@beezlabs.com
GIT_COMMITTER_EMAIL: github@beezlabs.com
run: |
git add -A
git diff-index --quiet HEAD || git commit -m "feat: Update app manifest for ${{ inputs.app-name }} in cluster ${{ inputs.cluster }} for release $RELEASE_ID"
git push
shell: bash