Skip to content

Docs: Server deployment #5

Docs: Server deployment

Docs: Server deployment #5

Workflow file for this run

name: "Backend: Helm Chart"
on:
push:
branches:
- main
pull_request:
paths:
- backend/deploy/**
- .github/**
branches:
- main
jobs:
# Lint and package the Helm chart, and upload the package as an artifact.
package:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.16.1
- uses: actions/setup-python@v4
with:
python-version: "3.12"
check-latest: true
- name: Install chart-testing CLI
uses: helm/chart-testing-action@v2
- name: Lint Helm chart
run: ct lint --target-branch main --charts backend/deploy/jobq-server
- name: Package Helm chart
run: helm package backend/deploy/jobq-server
- name: Upload Helm chart artifact
uses: actions/upload-artifact@v4
with:
name: helm-chart
path: jobq-server-*.tgz
# Update the Helm chart repository index under `/index.yaml` on the pages branch, adding the latest chart artifact.
publish:
runs-on: ubuntu-latest
needs: package
if: ${{ github.ref == 'refs/heads/main' }}
concurrency: release-helm
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: gh-pages
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Download Helm chart artifact
uses: actions/download-artifact@v4
with:
name: helm-chart
path: charts/
- name: Set up Helm
uses: azure/setup-helm@v4
- name: Publish Helm chart
run: >
helm repo index .
--merge ./index.yaml
--url https://raw.githubusercontent.com/${{ github.repository }}/gh-pages/charts/
- name: Commit and push changes
run: |
git add index.yaml charts/
git commit -m "Update Helm chart repository" && git push || true