Skip to content

Commit d29fea9

Browse files
sreyapull[bot]
authored andcommitted
feat: publish helm chart to helm.coder.com (#4793)
1 parent 0fa6b64 commit d29fea9

File tree

2 files changed

+32
-10
lines changed

2 files changed

+32
-10
lines changed

.github/workflows/release.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ permissions:
2020
contents: write
2121
# Necessary to push docker images to ghcr.io.
2222
packages: write
23+
# Necessary for GCP authentication (https://github.com/google-github-actions/setup-gcloud#usage)
24+
id-token: write
2325

2426
env:
2527
CODER_RELEASE: ${{ github.event.inputs.snapshot && 'false' || 'true' }}
@@ -167,6 +169,26 @@ jobs:
167169
env:
168170
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
169171

172+
- name: Authenticate to Google Cloud
173+
uses: google-github-actions/auth@v0
174+
with:
175+
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_ID_PROVIDER }}
176+
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
177+
178+
- name: Setup GCloud SDK
179+
uses: 'google-github-actions/setup-gcloud@v0'
180+
181+
- name: Publish Helm Chart
182+
run: |
183+
set -euo pipefail
184+
version="$(./scripts/version.sh)"
185+
mkdir -p build/helm
186+
cp "build/coder_helm_${version}.tgz" build/helm
187+
gsutil cp gs://helm.coder.com/v2/index.yaml build/helm/index.yaml
188+
helm repo index build/helm --url https://helm.coder.com/v2 --merge build/helm/index.yaml
189+
gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/coder_helm_${version}.tgz gs://helm.coder.com/v2
190+
gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/index.yaml gs://helm.coder.com/v2
191+
170192
- name: Upload artifacts to actions (if dry-run or snapshot)
171193
if: ${{ github.event.inputs.dry_run || github.event.inputs.snapshot }}
172194
uses: actions/upload-artifact@v2

docs/install/kubernetes.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@ to log in and manage templates.
5757
[Postgres operator](https://github.com/zalando/postgres-operator) to
5858
manage PostgreSQL deployments on your Kubernetes cluster.
5959

60-
1. Download the latest `coder_helm` package from
61-
[GitHub releases](https://github.com/coder/coder/releases).
60+
1. Add the Coder Helm repo:
6261

6362
```console
64-
wget https://github.com/coder/coder/releases/download/<release>/coder_helm_<release>.tgz
63+
helm repo add coder-v2 https://helm.coder.com/v2
6564
```
6665

6766
1. Create a secret with the database URL:
@@ -116,10 +115,10 @@ to log in and manage templates.
116115
> [values.yaml](https://github.com/coder/coder/blob/main/helm/values.yaml)
117116
> file directly.
118117
119-
1. Run the following commands to install the chart in your cluster.
118+
1. Run the following command to install the chart in your cluster.
120119

121120
```sh
122-
helm install coder ./coder_helm_x.y.z.tgz \
121+
helm install coder coder-v2/coder \
123122
--namespace coder \
124123
--values values.yaml
125124
```
@@ -139,12 +138,13 @@ to log in and manage templates.
139138
## Upgrading Coder via Helm
140139

141140
To upgrade Coder in the future or change values,
142-
you can run the following command with a new `coder_helm_x.y.z.tgz` file from GitHub releases:
141+
you can run the following command:
143142

144-
```console
145-
$ helm upgrade coder ./coder_helm_x.y.z.tgz \
146-
--namespace coder \
147-
-f values.yaml
143+
```sh
144+
helm repo update
145+
helm upgrade coder coder-v2/coder \
146+
--namespace coder \
147+
-f values.yaml
148148
```
149149

150150
## Troubleshooting

0 commit comments

Comments
 (0)