docs: init with mkdocs #1
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
name: Docs | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# we only want to clone the documentation here | |
sparse-checkout: | | |
docs/ | |
overrides/ | |
mkdocs.yml | |
sparse-checkout-cone-mode: false | |
# and we want to get all history for the docs | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- uses: actions/cache@v4 | |
with: | |
key: mkdocs-material- | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
- name: Install system dependencies | |
run: apt-get install pngquant | |
- name: Install mkdocs and friends | |
run: | | |
python -m pip install mkdocs-material[imaging] mkdocs-git-revision-date-localized-plugin \ | |
mkdocs-git-committers-plugin-2 pymdown-extensions Pygments | |
- name: Build | |
uses: python -m mkdocs build | |
- name: Upload Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: site/ | |
Deploy: | |
environment: | |
name: docs | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: Build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |