Skip to content

Commit bb5172e

Browse files
committed
ci: add workflow to publish devnotes independently of releases
Adds a GitHub Actions workflow that rebuilds the `latest` docs alias when devnotes change on main, so blog posts go live without cutting a package release.
1 parent 54d51bd commit bb5172e

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish devnotes
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "docs/devnotes/**"
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-notebooks:
12+
uses: ./.github/workflows/build-notebooks.yml
13+
with:
14+
use_cache: true
15+
secrets: inherit
16+
17+
deploy:
18+
needs: build-notebooks
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v6
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v7
27+
with:
28+
version: "0.9.5"
29+
- name: Set up Python
30+
run: uv python install 3.11
31+
- name: Install dependencies for docs
32+
run: uv sync --all-packages --group docs
33+
- name: Download notebooks
34+
uses: actions/download-artifact@v7
35+
with:
36+
name: notebooks
37+
path: docs/notebooks
38+
- name: Get latest release version
39+
run: |
40+
LATEST_TAG=$(gh release view --json tagName -q .tagName 2>/dev/null)
41+
if [ -z "$LATEST_TAG" ]; then
42+
echo "::error::No published release found. Publish a release first."
43+
exit 1
44+
fi
45+
VERSION=$(echo "$LATEST_TAG" | sed 's/^v//' | sed 's/ .*$//')
46+
echo "::notice::Rebuilding docs for version $VERSION (latest)"
47+
echo "VERSION=$VERSION" >> $GITHUB_ENV
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
- name: Setup doc deploy
51+
run: |
52+
git fetch origin gh-pages --depth=1
53+
git config --global user.name "github-actions[bot]"
54+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
55+
- name: Rebuild latest docs
56+
run: uv run mike deploy --push --update-aliases ${{ env.VERSION }} latest

0 commit comments

Comments
 (0)