Skip to content

Commit 13676ef

Browse files
ci: publish showcase Helm chart to GitHub Pages via chart-releaser
Add a chart-releaser workflow that publishes index.yaml and packaged charts to gh-pages when Chart.yaml version bumps on main, alongside the existing GHCR OCI publish path. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent ad18b23 commit 13676ef

4 files changed

Lines changed: 126 additions & 1 deletion

File tree

.github/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,40 @@ docker build -f frontend/Dockerfile \
114114

115115
---
116116

117+
## Workflow: Publish showcase Helm chart (GHCR OCI)
118+
119+
**File:** `.github/workflows/helm-publish-showcase.yaml`
120+
**Name:** `Publish showcase Helm chart (GHCR OCI)`
121+
122+
**Triggers:** Push to **`main`** when **`charts/showcase/**`** (or the workflow) changes; **`workflow_dispatch`**.
123+
124+
Packages **`charts/showcase`** and pushes to **`oci://ghcr.io/bcgov/bc-wallet-showcase-chart`**. Does not require a chart version bump (overwrites the OCI tag for the packaged version).
125+
126+
---
127+
128+
## Workflow: Release showcase Helm chart (GitHub Pages)
129+
130+
**File:** `.github/workflows/helm-release-showcase.yaml`
131+
**Name:** `Release showcase Helm chart (GitHub Pages)`
132+
133+
**Triggers:** Push to **`main`** when **`charts/showcase/**`** (or the workflow) changes; **`workflow_dispatch`**.
134+
135+
Runs **chart-releaser** when **`charts/showcase/Chart.yaml`** **`version`** is new: creates a GitHub Release, packages the chart (with vendored dependencies), and updates **`index.yaml`** on the **`gh-pages`** branch.
136+
137+
**Helm repo URL:** `https://bcgov.github.io/BC-Wallet-Demo`
138+
139+
**One-time setup:** In the GitHub repository, enable **Pages** with source branch **`gh-pages`** / **`/ (root)`**.
140+
141+
**Install:**
142+
143+
```bash
144+
helm repo add bc-wallet-showcase https://bcgov.github.io/BC-Wallet-Demo
145+
helm repo update
146+
helm install my-showcase bc-wallet-showcase/showcase --version <chart-version>
147+
```
148+
149+
---
150+
117151
## Related docs
118152

119153
- Root [README.md](../README.md) — run and Docker overview for developers.

.github/workflows/helm-lint-showcase.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- '.github/workflows/deploy-showcase-pr.yaml'
1111
- '.github/workflows/undeploy-showcase-pr.yaml'
1212
- '.github/workflows/helm-publish-showcase.yaml'
13+
- '.github/workflows/helm-release-showcase.yaml'
1314
- '.github/actions/showcase-build-server/**'
1415
- '.github/actions/showcase-build-frontend/**'
1516
- '.github/actions/showcase-setup-oc-helm/**'
@@ -24,6 +25,7 @@ on:
2425
- '.github/workflows/deploy-showcase-pr.yaml'
2526
- '.github/workflows/undeploy-showcase-pr.yaml'
2627
- '.github/workflows/helm-publish-showcase.yaml'
28+
- '.github/workflows/helm-release-showcase.yaml'
2729
- '.github/actions/showcase-build-server/**'
2830
- '.github/actions/showcase-build-frontend/**'
2931
- '.github/actions/showcase-setup-oc-helm/**'
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release showcase Helm chart (GitHub Pages)
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- 'charts/showcase/**'
10+
- '.github/workflows/helm-release-showcase.yaml'
11+
- '.github/actions/showcase-helm-lint/**'
12+
13+
permissions:
14+
contents: write
15+
16+
concurrency:
17+
group: helm-release-showcase-${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: false
19+
20+
jobs:
21+
release:
22+
name: chart-releaser → gh-pages
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
26+
with:
27+
fetch-depth: 0
28+
29+
- uses: ./.github/actions/showcase-helm-lint
30+
with:
31+
skip_checkout: 'true'
32+
33+
- name: Configure Git
34+
run: |
35+
git config user.name "$GITHUB_ACTOR"
36+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
37+
38+
- name: Run chart-releaser
39+
uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0
40+
with:
41+
charts_dir: charts
42+
skip_existing: true
43+
env:
44+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
45+
46+
- name: Release summary
47+
if: always()
48+
run: |
49+
{
50+
echo "### Showcase chart (GitHub Pages)"
51+
echo ""
52+
echo "When \`charts/showcase/Chart.yaml\` **version** increases, chart-releaser publishes a GitHub Release and updates the **gh-pages** index."
53+
echo ""
54+
echo "**Helm repo:** \`https://bcgov.github.io/BC-Wallet-Demo\`"
55+
echo ""
56+
echo '```bash'
57+
echo "helm repo add bc-wallet-showcase https://bcgov.github.io/BC-Wallet-Demo"
58+
echo "helm repo update"
59+
echo "helm search repo bc-wallet-showcase"
60+
echo '```'
61+
} >> "$GITHUB_STEP_SUMMARY"

charts/showcase/README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,34 @@ helm dependency update
1717

1818
## Install
1919

20+
### From the GitHub Pages Helm repo (recommended)
21+
22+
Published merges to **`main`** that bump **`charts/showcase/Chart.yaml`** **`version`** are released via **chart-releaser** to the **`gh-pages`** branch (see **`.github/workflows/helm-release-showcase.yaml`**). Enable **GitHub Pages** on the repository (**Settings → Pages → Deploy from branch `gh-pages` / root**) before the first release.
23+
24+
```bash
25+
helm repo add bc-wallet-showcase https://bcgov.github.io/BC-Wallet-Demo
26+
helm repo update
27+
helm search repo bc-wallet-showcase
28+
29+
helm upgrade --install my-showcase bc-wallet-showcase/showcase \
30+
--version 0.4.0 \
31+
-f deploy/showcase/values-dev.yaml \
32+
--namespace <namespace> \
33+
--create-namespace
34+
```
35+
36+
### From GHCR (OCI)
37+
38+
The same chart is also pushed to **`oci://ghcr.io/bcgov/bc-wallet-showcase-chart`** on **`main`** when chart files change (see **`.github/workflows/helm-publish-showcase.yaml`**).
39+
40+
```bash
41+
helm upgrade --install my-showcase oci://ghcr.io/bcgov/bc-wallet-showcase-chart \
42+
--version 0.4.0 \
43+
-f deploy/showcase/values-dev.yaml \
44+
--namespace <namespace> \
45+
--create-namespace
46+
```
47+
2048
### OpenShift / BC Gov Silver (recommended overlay)
2149

2250
Use **`deploy/showcase/values-dev.yaml`** for the shared **dev** overlay (ingress, route timeouts, optional auto-secrets, NetworkPolicy, public dev URL). Copy or override for other namespaces or hostnames.
@@ -122,6 +150,6 @@ Quick **public** checks (replace host with yours): **`curl -i`** to **`…/serve
122150

123151
## CI
124152

125-
PRs touching **`charts/showcase/**`** or **`deploy/showcase/**`** run **`helm dependency update`**, **`helm lint`** (default values, **`deploy/showcase/values-dev.yaml`**, and **`deploy/showcase/values-pr.yaml`**), and **`helm template`** (see **`.github/workflows/helm-lint-showcase.yaml`**). Merges to **`main`** can run **`Deploy showcase (dev)`** when repository variables and a token secret are configured (see **`.github/workflows/deploy-showcase-dev.yaml`**).
153+
PRs touching **`charts/showcase/**`** or **`deploy/showcase/**`** run **`helm dependency update`**, **`helm lint`** (default values, **`deploy/showcase/values-dev.yaml`**, and **`deploy/showcase/values-pr.yaml`**), and **`helm template`** (see **`.github/workflows/helm-lint-showcase.yaml`**). Merges to **`main`** with a bumped chart **`version`** publish to **GitHub Pages** (**`.github/workflows/helm-release-showcase.yaml`**) and to **GHCR OCI** (**`.github/workflows/helm-publish-showcase.yaml`**). Merges to **`main`** can run **`Deploy showcase (dev)`** when repository variables and a token secret are configured (see **`.github/workflows/deploy-showcase-dev.yaml`**).
126154

127155
**PR environments** (bcgov repo only): **`.github/workflows/deploy-showcase-pr.yaml`** builds and pushes **`ghcr.io/bcgov/bc-wallet-showcase-{server,frontend}:pr-<N>`**, then **`helm upgrade --install pr-<N>-showcase`** with **`deploy/showcase/values-pr.yaml`**. Public URL uses workflow default host suffix **`bc-wallet-showcase-dev.apps.silver.devops.gov.bc.ca`** (override with repository variable **`SHOWCASE_PR_HOST_SUFFIX`** if needed). Requires OpenShift secrets **`OPENSHIFT_SERVER`**, **`OPENSHIFT_TOKEN`**, **`OPENSHIFT_DEV_NAMESPACE`**. **`.github/workflows/undeploy-showcase-pr.yaml`** runs on PR close to **`helm uninstall`** and delete labeled **`Secret`**/**`PVC`**.

0 commit comments

Comments
 (0)