Update adding-an-api-specification.md #38
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Publish docs | |
on: | |
# Allow running the workflow manually from the GitHub UI | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
# Only run on changes to docs | |
- ".github/workflows/publish-docs.yml" | |
- "docs/**" | |
- "mkdocs.yml" | |
- "requirements.txt" | |
permissions: | |
contents: write | |
jobs: | |
deploy_docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Fetch all history for all tags and branches | |
# mkdocs-git-revision-date-localized-plugin needs access to the last commit that touched a specific file | |
with: | |
fetch-depth: 0 | |
- name: Configure Git credentials | |
run: | | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
cache: 'pip' | |
cache-dependency-path: 'requirements.txt' | |
- name: Create cache id | |
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install -r ./requirements.txt | |
- name: Deploy to GitHub Pages | |
run: mkdocs gh-deploy --force |