Initial commit #5
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
# Builds and deploys docs to GitHub Pages | |
name: Publish Docs | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run | |
# in-progress and latest queued. However, do NOT cancel in-progress runs in order | |
# to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
env: | |
source-dir: examples/mkdocs # The directory containing the MkDocs configuration file | |
output-dir: site # The directory containing the generated site | |
jobs: | |
# Build docs with MkDocs | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Pages | |
uses: actions/configure-pages@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install --upgrade mkdocs-walt | |
- name: Build with MkDocs | |
working-directory: ${{ env.source-dir }} | |
run: mkdocs build -d ${{ env.output-dir }} --verbose --clean --strict | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ${{ env.source-dir }}/${{ env.output-dir }} | |
# Deployment to GitHub Pages | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |