forked from Azure-Samples/aks-store-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (54 loc) · 1.92 KB
/
package-helm-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
name: package-helm-chart
on:
push:
branches:
- main
paths:
- 'charts/**'
workflow_dispatch:
jobs:
package-helm-chart:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set environment variables
id: set-variables
run: |
echo "REPOSITORY=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
echo "VERSION=$(yq -r .version ./charts/aks-store-demo/Chart.yaml)" >> "$GITHUB_OUTPUT"
- name: Env variable output
id: test-variables
run: |
echo ${{ steps.set-variables.outputs.REPOSITORY }}
echo ${{ steps.set-variables.outputs.VERSION }}
- name: Login to GitHub Container Registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Package and push helm chart
run: |
helm package ./charts/aks-store-demo --version ${{ steps.set-variables.outputs.VERSION }}
helm push ./aks-store-demo-chart-${{ steps.set-variables.outputs.VERSION }}.tgz oci://${{ steps.set-variables.outputs.REPOSITORY }}/charts
publish-helm-chart:
permissions:
id-token: write
packages: write
contents: write
actions: read
deployments: read
pull-requests: read
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Publish Helm chart to GitHub Pages
uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 # v1.7.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
linting: off