-
Notifications
You must be signed in to change notification settings - Fork 13
72 lines (68 loc) · 2.43 KB
/
publish_chart.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
name: publish-chart
on:
workflow_dispatch:
inputs:
bucketeer_version:
description: "Bucketeer version"
required: false
skip_release_note:
description: "Skip release note"
type: boolean
default: true
push:
branches:
- main
tags:
- "v*"
paths-ignore:
- "README.md"
- "ui/web-v2/README.md"
- "CLA.md"
- "CONTRIBUTING.md"
- "DEPLOYMENT.md"
- ".github/**"
env:
REGISTRY: ghcr.io
GAR_REGISTRY: asia-docker.pkg.dev
HELM_VERSION: 3.8.2
jobs:
artifacts:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
checks: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Determine version
run: |
if [ ! -z ${{ github.event.inputs.bucketeer_version }} ]; then
echo "BUCKETEER_VERSION=${{ github.event.inputs.bucketeer_version }}" >> $GITHUB_ENV
else
echo "BUCKETEER_VERSION=$(git describe --tags --always --abbrev=7)" >> $GITHUB_ENV
fi
- name: Install helm
uses: Azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: ${{ env.HELM_VERSION }}
- name: Build helm chart
run: make build-chart VERSION=${{ env.BUCKETEER_VERSION }}
- name: Login to GHCR OCI using Helm
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ${{ env.REGISTRY }} --username ${{ github.repository_owner }} --password-stdin
- name: Publish helm chart to GHCR
run: helm push .artifacts/bucketeer-${{ env.BUCKETEER_VERSION }}.tgz oci://${{ env.REGISTRY }}/bucketeer-io/chart
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@5a50e581162a13f4baa8916d01180d2acbc04363 # v2.1.0
with:
token_format: "access_token"
workload_identity_provider: ${{ secrets.GAR_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GAR_SA_MAIL_ADDRESS }}
- name: Login to GAR OCI using Helm
run: echo "${{ steps.auth.outputs.access_token }}" | helm registry login ${{ env.GAR_REGISTRY }} --username oauth2accesstoken --password-stdin
- name: Publish helm chart to GAR
run: helm push .artifacts/bucketeer-${{ env.BUCKETEER_VERSION }}.tgz oci://${{ env.GAR_REGISTRY }}/bucketeer-io/bucketeer/chart