-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 2.09 KB
/
Copy pathhelm.yml
File metadata and controls
60 lines (52 loc) · 2.09 KB
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
name: Release Helm chart
on:
push:
branches: [main]
tags: ['v*']
paths:
- 'charts/**'
- '.github/workflows/helm.yml'
workflow_dispatch:
jobs:
oci:
name: Publish to GHCR (OCI)
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v6
- name: Install Helm
run: curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set chart version from git tag
if: startsWith(github.ref, 'refs/tags/v')
run: |
VERSION="${GITHUB_REF_NAME#v}"
sed -i "s/^version:.*/version: ${VERSION}/" charts/envoy-router/Chart.yaml
sed -i "s/^appVersion:.*/appVersion: \"${GITHUB_REF_NAME}\"/" charts/envoy-router/Chart.yaml
- name: Package and push
run: |
helm package charts/envoy-router --destination /tmp/helm
for tgz in /tmp/helm/envoy-router-*.tgz; do
helm push "$tgz" oci://ghcr.io/${{ github.repository_owner }}/charts
done
- name: Summary
run: |
VERSION=$(grep '^version:' charts/envoy-router/Chart.yaml | awk '{print $2}')
REGISTRY="oci://ghcr.io/${{ github.repository_owner }}/charts"
echo "## Helm chart published" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "| | |" >> "$GITHUB_STEP_SUMMARY"
echo "|---|---|" >> "$GITHUB_STEP_SUMMARY"
echo "| **Chart** | \`envoy-router\` |" >> "$GITHUB_STEP_SUMMARY"
echo "| **Version** | \`${VERSION}\` |" >> "$GITHUB_STEP_SUMMARY"
echo "| **Registry** | \`${REGISTRY}\` |" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo '```bash' >> "$GITHUB_STEP_SUMMARY"
echo "helm install envoy-router ${REGISTRY}/envoy-router --version ${VERSION}" >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"