diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..81bbcf8 --- /dev/null +++ b/.github/workflows/docs.yml @@ -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