Skip to content

35 automate the documentation rendering and publishing #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Publish Documentation

on:
push:
branches: main

jobs:
publish-documentation:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Generate token for version incrementer app
id: create_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}
token: ${{ steps.create_token.outputs.token }}

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: Install dependencies
run: uv sync

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Render and Publish
run: uv run quarto publish gh-pages --no-prompt --no-browser

- name: Render Documentation
run: |
# Publish Quarto documentation
quarto publish --no-prompt --no-browser

# Render README in GitHub Flavored Markdown
quarto render index.qmd --output-dir . --output README.md --to gfm

# Remove index.html if it exists
rm -f index.html

- name: Commit version change
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update README"
branch: ${{ github.ref_name }}
file_pattern: "README.md"
Loading