-
Notifications
You must be signed in to change notification settings - Fork 74
103 lines (92 loc) · 3.91 KB
/
chart_release.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Helm Chart Release
on:
release:
types: [published]
workflow_dispatch:
jobs:
chart-release:
name: Create and Publish Chart Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v4
- name: Add bitnami repository
run: helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Run chart-releaser
uses: ./.github/actions/chart_releaser
with:
config: .github/actions/chart_releaser/cr.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
update-configs-and-sync:
runs-on: ubuntu-latest
name: Update Configs and Sync
needs:
- chart-release
steps:
- uses: actions/checkout@v4
- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Checkout services directory from the trust-over-ip-configurations repo
uses: actions/checkout@v4
with:
repository: bcgov/trust-over-ip-configurations
ssh-key: ${{ secrets.DITP_CONFIGS_REPO_SECRET }}
sparse-checkout: |
services
path: trust-over-ip-configurations
- name: Lookup latest chart
id: chart_version
run: |
helm repo add vc-authn-oidc https://bcgov.github.io/vc-authn-oidc
helm repo update
echo "APP_VERSION=$(helm search repo vc-authn-oidc -ojson | jq '.[0].app_version')" >> $GITHUB_OUTPUT
echo "CHART_VERSION=$(helm search repo vc-authn-oidc -ojson | jq '.[0].version')" >> $GITHUB_OUTPUT
- name: Update test
env:
APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }}
CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }}
run: |
cd trust-over-ip-configurations
yq e -i '.appVersion = env(APP_VERSION)' services/vc-authn-oidc/charts/test/Chart.yaml
yq e -i '.version = env(CHART_VERSION)' services/vc-authn-oidc/charts/test/Chart.yaml
yq e -i '.dependencies[0].version = env(CHART_VERSION)' services/vc-authn-oidc/charts/test/Chart.yaml
- name: Update prod
env:
APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }}
CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }}
run: |
cd trust-over-ip-configurations
yq e -i '.appVersion = env(APP_VERSION)' services/vc-authn-oidc/charts/prod/Chart.yaml
yq e -i '.version = env(CHART_VERSION)' services/vc-authn-oidc/charts/prod/Chart.yaml
yq e -i '.dependencies[0].version = env(CHART_VERSION)' services/vc-authn-oidc/charts/prod/Chart.yaml
- name: Commit and Push to trust-over-ip-configurations Repo
run: |
cd trust-over-ip-configurations
git add services/vc-authn-oidc/charts/test/Chart.yaml services/vc-authn-oidc/charts/prod/Chart.yaml
git commit -m "Update chart and app versions" || echo "No changes to commit"
git push origin main
- name: Trigger and wait for GitOps sync workflow
uses: convictional/[email protected]
id: workflow-trigger
with:
owner: bcgov
repo: trust-over-ip-configurations
github_token: ${{ secrets.DITP_CONFIGS_REPO_TOKEN }}
workflow_file_name: gitops_sync.yaml
- name: Trigger ArgoCD Sync of e79518-test-vc-authn-oidc
uses: OpsVerseIO/[email protected]
with:
address: gitops-shared.apps.silver.devops.gov.bc.ca
token: ${{ secrets.DITP_GITOPS_ARGO_SECRET}}
action: sync
appName: "e79518-test-vc-authn-oidc"