Skip to content

[WIP] Create a handbook for our group (#62) #5

[WIP] Create a handbook for our group (#62)

[WIP] Create a handbook for our group (#62) #5

Workflow file for this run

name: Build and Deploy Handbook
on:
push:
branches:
- main
paths:
- 'handbook/**'
- 'mkdocs.yml'
- 'pyproject.toml'
- '.github/workflows/handbook.yml'
pull_request:
branches:
- main
paths:
- 'handbook/**'
- 'mkdocs.yml'
- 'pyproject.toml'
- '.github/workflows/handbook.yml'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
pull-requests: 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 repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install dependencies
run: uv sync
- name: Build documentation
run: uv run mkdocs build --site-dir site
- name: Upload artifact for GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: ./site
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: handbook-site
path: ./site
# Post artifact link in PR comments
post-artifact:
if: github.event_name == 'pull_request'
needs: build
runs-on: ubuntu-latest
steps:
- name: Post artifact link
uses: CDCgov/cfa-actions/post-artifact@main
with:
artifact-name: handbook-site
gh-token: ${{ secrets.GITHUB_TOKEN }}
# Deploy to GitHub Pages (only on main branch)
deploy:
if: github.ref == 'refs/heads/main'
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