deploy-docs #13
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
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". | |
name: deploy-docs | |
on: | |
workflow_dispatch: {} | |
workflow_run: | |
workflows: | |
- release | |
types: | |
- completed | |
workflow_call: | |
inputs: | |
version: | |
required: false | |
type: string | |
description: Version to build and publish docs | |
alias: | |
required: false | |
type: string | |
description: Alias to associate version (latest, stage) | |
jobs: | |
deploy-docs: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pages: write | |
outputs: | |
getVersion: ${{ steps.getVersion.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- run: echo "cache_id=$(date --utc "+%V")" >> $GITHUB_ENV | |
- uses: actions/cache@v4 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
- name: Install doc generations dependencies | |
run: |- | |
pip install --upgrade pip | |
pip install -r docs/requirements.txt | |
pip install mkdocs-material | |
pip install mike | |
- name: Setup docs deploy | |
run: |- | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
- name: Get the version | |
id: getVersion | |
run: |- | |
echo "version=$(git describe --tags --abbrev=0)" | |
echo "version=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT" | |
- name: Build and deploy documentation | |
env: | |
ALIAS: latest | |
VERSION: ${{ steps.getVersion.outputs.version }} | |
run: |- | |
echo ${{ env.VERSION }} | |
mike deploy --push --update-aliases ${{ env.VERSION }} ${{ env.ALIAS }} | |
mike set-default --push ${{ env.ALIAS }} |