mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
84 lines
2.3 KiB
YAML
84 lines
2.3 KiB
YAML
name: "Docs: Release to GitHub pages"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- ".github/workflows/docs-release.yaml"
|
|
- ".ci/mkdocs/mkdocs.yml"
|
|
- "docs/**"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
jobs:
|
|
build-docs:
|
|
name: Build documentation
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout main branch
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
|
|
- name: Install requirements
|
|
run: pip install -r docs/requirements.txt
|
|
|
|
- name: Build and publish docs
|
|
run: mkdocs build -f .ci/mkdocs/mkdocs.yml
|
|
|
|
- name: Generate Token
|
|
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
|
|
id: app-token
|
|
with:
|
|
app-id: ${{ secrets.LAB_ASSISTANT_APP_ID }}
|
|
private-key: ${{ secrets.LAB_ASSISTANT_APP_KEY }}
|
|
|
|
- name: Deploy
|
|
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
with:
|
|
github_token: ${{ steps.app-token.outputs.token }}
|
|
publish_dir: ./site
|
|
destination_dir: docs
|
|
|
|
publish-docs:
|
|
name: Publish documentation
|
|
runs-on: ubuntu-24.04
|
|
needs:
|
|
- build-docs
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- name: Checkout main branch
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
path: src
|
|
persist-credentials: false
|
|
|
|
- name: Checkout gh-pages branch
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
ref: gh-pages
|
|
path: gh-pages
|
|
persist-credentials: false
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: ./src/.github/actions/publish-folder-to-pages
|
|
with:
|
|
path: gh-pages/
|
|
deleteArtifactAfterPublish: true
|