mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
65 lines
1.7 KiB
YAML
65 lines
1.7 KiB
YAML
name: "Docs: Release to GitHub pages"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- '.ci/mkdocs/mkdocs.yaml'
|
|
- '.github/workflows/docs-release.yaml'
|
|
- "docs/**"
|
|
|
|
jobs:
|
|
release-docs:
|
|
name: Release documentation
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Get GitHub API token
|
|
id: get-app-token
|
|
uses: getsentry/action-github-app-token@v1
|
|
with:
|
|
app_id: ${{ secrets.BJWS_APP_ID }}
|
|
private_key: ${{ secrets.BJWS_APP_PRIVATE_KEY }}
|
|
|
|
- name: Checkout charts branch
|
|
uses: actions/checkout@v3
|
|
with:
|
|
token: ${{ steps.get-app-token.outputs.token }}
|
|
path: "src"
|
|
fetch-depth: 0
|
|
|
|
- name: Checkout gh-pages branch
|
|
uses: actions/checkout@v3
|
|
with:
|
|
token: ${{ steps.get-app-token.outputs.token }}
|
|
path: "dest"
|
|
ref: "gh-pages"
|
|
fetch-depth: 0
|
|
|
|
- name: Install Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install mkdocs
|
|
shell: bash
|
|
working-directory: src
|
|
run: |
|
|
pip install -r ./.ci/mkdocs/requirements.txt
|
|
|
|
- name: Build documentation
|
|
shell: bash
|
|
working-directory: src
|
|
run: |
|
|
mkdocs build --config-file ./.ci/mkdocs/mkdocs.yaml -d "$PWD/../dest/docs"
|
|
|
|
- name: Commit changes
|
|
shell: bash
|
|
working-directory: dest
|
|
run: |
|
|
git config user.name "bjw-s-bot[bot]"
|
|
git config user.email "bjw-s-bot <87358111+bjw-s-bot[bot]@users.noreply.github.com>"
|
|
git add docs
|
|
git commit -m "Updated docs from ref: $GITHUB_SHA"
|
|
git push
|