57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: Publish docs
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'The version for which to publish the documentation'
|
|
required: true
|
|
updateAlias:
|
|
description: 'Update latest alias'
|
|
type: boolean
|
|
default: false
|
|
workflow_call:
|
|
inputs:
|
|
version:
|
|
required: true
|
|
type: string
|
|
updateAlias:
|
|
type: boolean
|
|
default: false
|
|
|
|
run-name: Publishing docs for ${{ inputs.version }}
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Configure Git Credentials
|
|
run: |
|
|
git config user.name github-actions[bot]
|
|
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.x
|
|
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
|
- uses: actions/cache@v4
|
|
with:
|
|
key: mkdocs-material-${{ env.cache_id }}
|
|
path: .cache
|
|
restore-keys: |
|
|
mkdocs-material-
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install mkdocs-material
|
|
pip install mkdocs-git-revision-date-localized-plugin mike
|
|
- name: Deploy and update alias
|
|
if: ${{ inputs.updateAlias }}
|
|
run: mike deploy --branch gh-pages --push --update-aliases ${{ inputs.version }} latest
|
|
- name: Deploy only
|
|
if: ${{ !inputs.updateAlias }}
|
|
run: mike deploy --branch gh-pages --push ${{ inputs.version }}
|