Merge pull request #37 from consideRatio/pr/update-curl #25
This file contains 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 is a GitHub workflow defining a set of jobs with a set of steps. | |
# ref: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions | |
# | |
# This workflow will publish the Helm chart to jupyterhub/helm-chart's gh-pages | |
# branch, which acts like a Helm chart repository (a static website with | |
# index.yaml following a certain syntax). | |
# | |
name: Publish | |
on: | |
push: | |
branches: | |
- "main" | |
paths-ignore: | |
- "**.md" | |
- ".github/workflows/*" | |
- "!.github/workflows/publish.yaml" | |
tags: | |
- "**" | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# chartpress requires the full history | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies (chartpress, helm) | |
run: | | |
pip install chartpress | |
curl -sf https://raw.githubusercontent.com/helm/helm/HEAD/scripts/get-helm-3 | bash | |
- name: Setup push rights to jupyterhub/helm-chart | |
# This was setup by... | |
# 1. Generating a private/public key pair: | |
# ssh-keygen -t ed25519 -C "jupyterhub/pebble-helm-chart" -f /tmp/id_ed25519 | |
# 2. Registering the private key (/tmp/id_ed25519) as a secret for this | |
# repo: | |
# https://github.com/jupyterhub/pebble-helm-chart/settings/secrets/actions | |
# 3. Registering the public key (/tmp/id_ed25519.pub) as a deploy key | |
# with push rights for the jupyterhub/helm chart repo: | |
# https://github.com/jupyterhub/helm-chart/settings/keys | |
run: | | |
mkdir -p ~/.ssh | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
echo "${{ secrets.JUPYTERHUB_HELM_CHART_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 | |
chmod 600 ~/.ssh/id_ed25519 | |
- name: Configure a git user | |
# Having a user.email and user.name configured with git is required to | |
# make commits, which is something chartpress does when publishing. | |
run: | | |
git config --global user.email "github-actions@example.local" | |
git config --global user.name "GitHub Actions user" | |
- name: Publish images and chart with chartpress | |
env: | |
GITHUB_REPOSITORY: "${{ github.repository }}" | |
run: | | |
./ci/publish |