-
Notifications
You must be signed in to change notification settings - Fork 272
62 lines (59 loc) · 2.58 KB
/
helm.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
name: Package and Upload Helm Chart Release
on:
push:
branches:
- "develop"
tags:
- "*"
jobs:
build:
name: Package and Upload Helm Chart Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(cat helm/charts/aleph/Chart.yaml | grep version | awk '{print $2}')
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
project_id: ${{ secrets.GCP_PROJECT_ID }}
export_default_credentials: true
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Copy existing charts for index regeneration
run: gsutil -m cp -r gs://aleph-helm-charts . && mv aleph-helm-charts charts
- name: Package chart
uses: WyriHaximus/github-action-helm3@v2
with:
exec: |
rm -f charts/aleph-${{ steps.get_version.outputs.VERSION }}-dev.tgz
helm package helm/charts/aleph --version ${{ steps.get_version.outputs.VERSION }}-dev --destination charts/
- name: Upload chart to GCS
env:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
if: env.GCP_PROJECT_ID != null
run: gsutil cp charts/aleph-${{ steps.get_version.outputs.VERSION }}-dev.tgz gs://aleph-helm-charts
- name: Package chart
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: WyriHaximus/github-action-helm3@v2
with:
exec: helm package helm/charts/aleph --version ${{ steps.get_version.outputs.VERSION }} --destination charts/
- name: Upload chart to GCS
env:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
if: env.GCP_PROJECT_ID != null && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: gsutil cp charts/aleph-${{ steps.get_version.outputs.VERSION }}.tgz gs://aleph-helm-charts
- name: Generate index
uses: WyriHaximus/github-action-helm3@v2
with:
exec: helm repo index charts/
- name: Upload index to GCS
env:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
if: env.GCP_PROJECT_ID != null && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && !startsWith(github.ref, 'refs/tags/test-')
run: |
gsutil cp charts/index.yaml gs://aleph-helm-charts/index.yaml
gsutil setmeta -h "Cache-Control:public, max-age=60" gs://aleph-helm-charts/index.yaml