Builds on push to main (docs/ or mkdocs.yml changes) and deploys to https://pyr0ball.github.io/discarr via actions/deploy-pages. Pinned to mkdocs-material 9.x (MIT, <10) — avoids 2.0 licence wall.
54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
name: Deploy docs to GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "docs/**"
|
|
- "mkdocs.yml"
|
|
workflow_dispatch: # allow manual trigger from Actions UI
|
|
|
|
# Grant GITHUB_TOKEN permission to deploy to Pages
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
# Only one deployment at a time; cancel in-flight runs on new push
|
|
concurrency:
|
|
group: pages
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
cache: pip
|
|
cache-dependency-path: docs/requirements.txt
|
|
|
|
- name: Install MkDocs
|
|
run: pip install -r docs/requirements.txt
|
|
|
|
- name: Build site
|
|
run: mkdocs build --strict --site-dir _site
|
|
|
|
- name: Upload Pages artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: _site
|
|
|
|
deploy:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|