-
Notifications
You must be signed in to change notification settings - Fork 7
67 lines (62 loc) · 2.34 KB
/
Copy pathhelpers-deploy-argo.yaml
File metadata and controls
67 lines (62 loc) · 2.34 KB
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
64
65
66
67
# This callable workflow builds and publish a package docker image via the helpers-build-docker-image workflow,
# and then updates the image tag in the Helm chart values file in the development-application-config repo.
name: helpers-deploy-argo
on:
workflow_call:
secrets:
KITTL_CI_APP_PRIVATE_KEY:
description: "The Kittl-CICD GitHub App private key to use for generating a short-living token"
required: true
ECR_ROLE_ARN:
description: "The ECR role ARN"
required: true
permissions:
contents: write
id-token: write
packages: read
jobs:
build-docker-image:
uses: ./.github/workflows/helpers-build-docker-image.yaml
name: Build Docker image
with:
docker_file_path: Dockerfile
secrets: inherit
update-helm-values:
name: Update Helm values
runs-on: ubuntu-latest
needs: build-docker-image
env:
ENVIRONMENT: ${{ github.ref == 'refs/heads/production' && 'production' || 'staging' }}
REPOSITORY: ${{ github.event.repository.name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate token
id: generate-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.KITTL_CI_APP_ID }}
private-key: ${{ secrets.KITTL_CI_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
development-applications-config
- name: Checkout helm config Repository
uses: actions/checkout@v4
with:
repository: Kittl/development-applications-config
ref: main
path: helm-config
token: ${{ steps.generate-token.outputs.token }}
persist-credentials: false
- name: Update Image Version in the related HelmChart values.yaml
uses: fjogeleit/yaml-update-action@v0.14.0
with:
valueFile: ${{ format('{0}/{1}/values.yaml', env.ENVIRONMENT, env.REPOSITORY) }}
propertyPath: 'deployment.image.tag'
value: ${{ needs.build-docker-image.outputs.image-tag }}
repository: Kittl/development-applications-config
branch: main
createPR: false
message: 'Update Image Version to ${{ needs.build-docker-image.outputs.image-tag }}'
token: ${{ steps.generate-token.outputs.token }}
workDir: helm-config