mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: publish helm chart to helm.coder.com (#4793)
This commit is contained in:
@@ -20,6 +20,8 @@ permissions:
|
||||
contents: write
|
||||
# Necessary to push docker images to ghcr.io.
|
||||
packages: write
|
||||
# Necessary for GCP authentication (https://github.com/google-github-actions/setup-gcloud#usage)
|
||||
id-token: write
|
||||
|
||||
env:
|
||||
CODER_RELEASE: ${{ github.event.inputs.snapshot && 'false' || 'true' }}
|
||||
@@ -167,6 +169,26 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Authenticate to Google Cloud
|
||||
uses: google-github-actions/auth@v0
|
||||
with:
|
||||
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_ID_PROVIDER }}
|
||||
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
|
||||
|
||||
- name: Setup GCloud SDK
|
||||
uses: 'google-github-actions/setup-gcloud@v0'
|
||||
|
||||
- name: Publish Helm Chart
|
||||
run: |
|
||||
set -euo pipefail
|
||||
version="$(./scripts/version.sh)"
|
||||
mkdir -p build/helm
|
||||
cp "build/coder_helm_${version}.tgz" build/helm
|
||||
gsutil cp gs://helm.coder.com/v2/index.yaml build/helm/index.yaml
|
||||
helm repo index build/helm --url https://helm.coder.com/v2 --merge build/helm/index.yaml
|
||||
gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/coder_helm_${version}.tgz gs://helm.coder.com/v2
|
||||
gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/index.yaml gs://helm.coder.com/v2
|
||||
|
||||
- name: Upload artifacts to actions (if dry-run or snapshot)
|
||||
if: ${{ github.event.inputs.dry_run || github.event.inputs.snapshot }}
|
||||
uses: actions/upload-artifact@v2
|
||||
|
||||
+10
-10
@@ -57,11 +57,10 @@ to log in and manage templates.
|
||||
[Postgres operator](https://github.com/zalando/postgres-operator) to
|
||||
manage PostgreSQL deployments on your Kubernetes cluster.
|
||||
|
||||
1. Download the latest `coder_helm` package from
|
||||
[GitHub releases](https://github.com/coder/coder/releases).
|
||||
1. Add the Coder Helm repo:
|
||||
|
||||
```console
|
||||
wget https://github.com/coder/coder/releases/download/<release>/coder_helm_<release>.tgz
|
||||
helm repo add coder-v2 https://helm.coder.com/v2
|
||||
```
|
||||
|
||||
1. Create a secret with the database URL:
|
||||
@@ -116,10 +115,10 @@ to log in and manage templates.
|
||||
> [values.yaml](https://github.com/coder/coder/blob/main/helm/values.yaml)
|
||||
> file directly.
|
||||
|
||||
1. Run the following commands to install the chart in your cluster.
|
||||
1. Run the following command to install the chart in your cluster.
|
||||
|
||||
```sh
|
||||
helm install coder ./coder_helm_x.y.z.tgz \
|
||||
helm install coder coder-v2/coder \
|
||||
--namespace coder \
|
||||
--values values.yaml
|
||||
```
|
||||
@@ -139,12 +138,13 @@ to log in and manage templates.
|
||||
## Upgrading Coder via Helm
|
||||
|
||||
To upgrade Coder in the future or change values,
|
||||
you can run the following command with a new `coder_helm_x.y.z.tgz` file from GitHub releases:
|
||||
you can run the following command:
|
||||
|
||||
```console
|
||||
$ helm upgrade coder ./coder_helm_x.y.z.tgz \
|
||||
--namespace coder \
|
||||
-f values.yaml
|
||||
```sh
|
||||
helm repo update
|
||||
helm upgrade coder coder-v2/coder \
|
||||
--namespace coder \
|
||||
-f values.yaml
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Reference in New Issue
Block a user