Skip to content

Commit cbce5d6

Browse files
fix(ci): restore docs deployment for Copier template repo
After the Copier migration, pyproject.toml and mkdocs.yml moved into template/ so the old docs.yml failed with "No pyproject.toml found". Fix: render the template to a temp dir first (same pattern as validate-template.yml), then run mkdocs build on the rendered output. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 20ba447 commit cbce5d6

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/docs.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
deploy:
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
25+
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
26+
with:
27+
version: "0.11.3"
28+
python-version: "3.12"
29+
- name: Configure git
30+
run: |
31+
git config --global user.name "CI"
32+
git config --global user.email "ci@test.com"
33+
- name: Render template
34+
run: |
35+
TEMPLATE_DIR=$(mktemp -d)
36+
git archive HEAD | tar -C "$TEMPLATE_DIR" -xf -
37+
uvx copier copy "$TEMPLATE_DIR" /tmp/rendered-docs \
38+
--trust \
39+
--defaults \
40+
--overwrite \
41+
--data project_name=python-template \
42+
--data description="A modern, batteries-included Python project template" \
43+
--data author_name=namitdeb739 \
44+
--data author_email=namitdeb739@users.noreply.github.com \
45+
--data github_user=namitdeb739
46+
- name: Build docs
47+
working-directory: /tmp/rendered-docs
48+
run: uv run mkdocs build --site-dir /tmp/site
49+
- uses: actions/upload-pages-artifact@v3
50+
with:
51+
path: /tmp/site
52+
- id: deployment
53+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)