release-complete #121
This file contains hidden or 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: Deploy Documentation | |
on: | |
repository_dispatch: | |
types: [release-complete] | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
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 as we want to allow these production deployments to | |
# complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Enable GitHub Pages if not already enabled | |
run: | | |
# Check if Pages is already enabled, if not enable it | |
if ! gh api repos/:owner/:repo/pages >/dev/null 2>&1; then | |
echo "GitHub Pages not enabled, attempting to enable..." | |
if gh api --method POST repos/:owner/:repo/pages -f build_type=workflow 2>/dev/null; then | |
echo "Successfully enabled GitHub Pages with GitHub Actions build type" | |
else | |
echo "Failed to enable GitHub Pages automatically - may need manual setup" | |
echo "See: https://docs.github.com/en/pages/getting-started-with-github-pages/enabling-github-pages-for-your-repository" | |
exit 1 | |
fi | |
else | |
echo "GitHub Pages already enabled" | |
fi | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: true | |
- name: Install dependencies | |
run: uv sync --group docs | |
- name: Build documentation | |
run: uv run mkdocs build --strict | |
- name: Upload documentation artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: site/ | |
deploy: | |
needs: build | |
if: github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' | |
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 |