ci: GitHub Pages workflow for MkDocs site
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.
This commit is contained in:
parent
dc768a8dbb
commit
5e5b3c8df2
1 changed files with 54 additions and 0 deletions
54
.github/workflows/docs.yml
vendored
Normal file
54
.github/workflows/docs.yml
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
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
|
||||||
Loading…
Reference in a new issue