-
Notifications
You must be signed in to change notification settings - Fork 12
feat(helm): Add workflow for publishing the Helm chart to GitHub Pages. #413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
20001020ycx
merged 3 commits into
y-scope:main
from
20001020ycx:feat/2026-07-22-helm-publish-workflow
Jul 23, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| name: "spider-helm" | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: &monitored_paths | ||
| - ".github/workflows/spider-helm.yaml" | ||
| - "taskfile.yaml" | ||
| - "taskfiles/**" | ||
| - "tools/deployment/spider-helm/**" | ||
| - "tools/yscope-dev-utils" | ||
| push: | ||
| paths: *monitored_paths | ||
| workflow_dispatch: | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: "${{github.workflow}}-${{github.ref}}" | ||
|
|
||
| # Cancel in-progress jobs for efficiency. Exclude the `main` branch to allow uninterrupted | ||
| # publishing of Helm charts. | ||
| cancel-in-progress: >- | ||
| ${{ | ||
| github.ref != 'refs/heads/main' | ||
| && !startsWith(github.ref, 'refs/heads/spider-huntsman-v') | ||
| }} | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: "ubuntu-latest" | ||
| steps: | ||
| - uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1" # v7.0.1 | ||
| with: | ||
| submodules: "recursive" | ||
|
|
||
| # Fetch all history for all branches; otherwise, `helm lint` would complain about not | ||
| # finding the `origin/main` branch. | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: "./tools/yscope-dev-utils/exports/github/actions/install-python" | ||
| with: | ||
| version: "3.10" | ||
|
|
||
| - uses: "./tools/yscope-dev-utils/exports/github/actions/install-go-task" | ||
|
20001020ycx marked this conversation as resolved.
|
||
| with: | ||
| version: "3.48.0" | ||
|
|
||
| - name: "Lint Helm charts" | ||
| shell: "bash" | ||
| run: "task lint:check-helm" | ||
|
|
||
| publish: | ||
| # Publish from `main` and `spider-huntsman-vA.B.C` release branches. | ||
| if: >- | ||
| github.event_name != 'pull_request' | ||
| && (github.ref == 'refs/heads/main' | ||
| || startsWith(github.ref, 'refs/heads/spider-huntsman-v')) | ||
| needs: "lint" | ||
|
20001020ycx marked this conversation as resolved.
|
||
| runs-on: "ubuntu-latest" | ||
|
20001020ycx marked this conversation as resolved.
|
||
| concurrency: | ||
| group: "${{github.workflow}}-gh-pages" | ||
| cancel-in-progress: false | ||
| permissions: | ||
| # To push to the `gh-pages` branch. | ||
| contents: "write" | ||
| steps: | ||
| - uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1" # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| submodules: "recursive" | ||
|
20001020ycx marked this conversation as resolved.
|
||
|
|
||
| - uses: "./tools/yscope-dev-utils/exports/github/actions/install-go-task" | ||
| with: | ||
| version: "3.48.0" | ||
|
|
||
| - name: "Package Helm chart" | ||
| shell: "bash" | ||
| run: "task helm:package" | ||
|
|
||
| - name: "Checkout branch `gh-pages`" | ||
| uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1" # v7.0.1 | ||
| with: | ||
| path: "gh-pages" | ||
| ref: "gh-pages" | ||
|
|
||
| - name: "Get chart version" | ||
| id: "get-chart-version" | ||
| uses: "mikefarah/yq@1b9b4ac5187171d2e5e3129be0cfa827c7f9d53d" # v4.53.3 | ||
| with: | ||
| cmd: "yq '.version' 'tools/deployment/spider-helm/Chart.yaml'" | ||
|
|
||
| - name: "Update Helm repository" | ||
| id: "update-helm-repo" | ||
| shell: "bash" | ||
| run: |- | ||
| chart_tgz="spider-${{steps.get-chart-version.outputs.result}}.tgz" | ||
|
|
||
| # Skip if this chart version already exists. | ||
| if [[ -f "gh-pages/${chart_tgz}" ]]; then | ||
| echo "Chart ${chart_tgz} already exists, skipping publish." | ||
| echo "skip_publish=true" >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
|
|
||
| cp "build/spider-helm"/*.tgz "gh-pages/" | ||
|
|
||
| # Update index.yaml, merging with existing index if present. | ||
| . "build/toolchains/helm/env" | ||
| url="${{github.server_url}}/${{github.repository}}/raw/gh-pages" | ||
| if [[ -f "gh-pages/index.yaml" ]]; then | ||
| helm repo index "gh-pages" --merge "gh-pages/index.yaml" --url "${url}" | ||
| else | ||
| helm repo index "gh-pages" --url "${url}" | ||
| fi | ||
|
|
||
| - name: "Push to gh-pages branch" | ||
| if: "steps.update-helm-repo.outputs.skip_publish != 'true'" | ||
| shell: "bash" | ||
| working-directory: "gh-pages" | ||
| run: |- | ||
| git config user.name "$GITHUB_ACTOR" | ||
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
| git add "*.tgz" "index.yaml" | ||
| commit_message="ci(helm): Publish spider-${{steps.get-chart-version.outputs.result}}" | ||
| commit_message+=" from ${{github.ref_name}} (${{github.sha}})." | ||
| git commit -m "$commit_message" | ||
| git push | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| version: "3" | ||
|
|
||
| includes: | ||
| toolchains: "toolchains.yaml" | ||
|
|
||
| vars: | ||
| G_SPIDER_HELM_BUILD_DIR: "{{.G_BUILD_DIR}}/spider-helm" | ||
|
|
||
| tasks: | ||
| package: | ||
| vars: | ||
| OUTPUT_DIR: "{{.G_SPIDER_HELM_BUILD_DIR}}" | ||
| deps: ["toolchains:helm"] | ||
| cmds: | ||
| - "rm -rf '{{.OUTPUT_DIR}}'" | ||
| - "mkdir -p '{{.OUTPUT_DIR}}'" | ||
| - |- | ||
| . "{{.G_HELM_TOOLCHAIN_ENV_FILE}}" | ||
| helm package "{{.ROOT_DIR}}/tools/deployment/spider-helm" --destination "{{.OUTPUT_DIR}}" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.