-
Notifications
You must be signed in to change notification settings - Fork 9
70 lines (59 loc) · 2.16 KB
/
publish-helm-cluster.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
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
---
name: 'Publish Helm chart Cluster'
on:
push:
branches:
- master
paths:
- "charts/cluster-hoprd/**"
concurrency:
group: ${{ github.head_ref }}-cluster
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-2-core
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: latest
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get Helm chart version
id: get_version
run: |
HELM_CHART_VERSION=$(grep '^version:' Chart.yaml | sed 's/.*: //')
echo "HELM_CHART_VERSION=${HELM_CHART_VERSION}" >> $GITHUB_OUTPUT
working-directory: 'charts/cluster-hoprd/'
- name: Set up Google Cloud Credentials
id: auth
uses: google-github-actions/auth@v1
with:
token_format: "access_token"
credentials_json: ${{ secrets.GOOGLE_HOPRASSOCIATION_CREDENTIALS_REGISTRY }}
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GOOGLE_HOPRASSOCIATION_PROJECT }}
install_components: beta
- name: Login Google Container Registry
uses: docker/login-action@v3
with:
registry: europe-west3-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Helm Package
run: |
helm package . --version ${{ steps.get_version.outputs.HELM_CHART_VERSION }}
working-directory: 'charts/cluster-hoprd/'
- name: Helm Publish
run: |
helm push cluster-hoprd-${{ steps.get_version.outputs.HELM_CHART_VERSION }}.tgz oci://europe-west3-docker.pkg.dev/hoprassociation/helm-charts
working-directory: 'charts/cluster-hoprd/'
- name: Tag Helm version
run: |
git config user.email "[email protected]"
git config user.name "HOPR CI robot"
git tag helm-cluster-hoprd-${{ steps.get_version.outputs.HELM_CHART_VERSION }}
git push origin helm-cluster-hoprd-${{ steps.get_version.outputs.HELM_CHART_VERSION }}