-
Notifications
You must be signed in to change notification settings - Fork 140
ci: publish devnotes independently of releases #536
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
andreatgretel
merged 5 commits into
main
from
andreatgretel/chore/publish-devnotes-workflow
Apr 13, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bb5172e
ci: add workflow to publish devnotes independently of releases
andreatgretel 6cfec5a
ci: pin actions to commit SHAs and restrict default permissions
andreatgretel 0cd7ca7
ci: build devnotes from last deployed state, not main
andreatgretel 4edd163
ci: add actions:read permission for notebook download
andreatgretel 2753fdc
Merge branch 'main' into andreatgretel/chore/publish-devnotes-workflow
andreatgretel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: Publish devnotes | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - "docs/devnotes/**" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: read | ||
| contents: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Get last deployed docs state | ||
| run: | | ||
| git fetch origin gh-pages --depth=1 | ||
| DEPLOY_MSG=$(git log FETCH_HEAD -1 --format="%s") | ||
| SOURCE_SHA=$(echo "$DEPLOY_MSG" | sed -n 's/^Deployed \([0-9a-f]*\) to .*/\1/p') | ||
| VERSION=$(echo "$DEPLOY_MSG" | sed -n 's/^Deployed [0-9a-f]* to \([^ ]*\) .*/\1/p') | ||
|
|
||
| if [ -z "$SOURCE_SHA" ] || [ -z "$VERSION" ]; then | ||
| echo "::error::Could not parse deploy info from gh-pages. Expected: 'Deployed <sha> to <version> ...'" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "::notice::Last deploy: commit $SOURCE_SHA for version $VERSION" | ||
| echo "SOURCE_SHA=$SOURCE_SHA" >> $GITHUB_ENV | ||
| echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
| - name: Checkout docs source and overlay devnotes | ||
| run: | | ||
| git checkout ${{ env.SOURCE_SHA }} | ||
| git checkout ${{ github.sha }} -- docs/devnotes/ | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7 | ||
| with: | ||
| version: "0.9.5" | ||
| - name: Set up Python | ||
| run: uv python install 3.11 | ||
| - name: Install dependencies for docs | ||
| run: uv sync --all-packages --group docs | ||
| - name: Download notebooks from last docs build | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| mkdir -p docs/notebooks | ||
| LAST_RUN_ID=$(gh run list --workflow build-docs.yml --status success --limit 1 --json databaseId -q '.[0].databaseId') | ||
| if [ -z "$LAST_RUN_ID" ]; then | ||
| echo "::error::No successful build-docs run found. Cannot build without notebooks." | ||
| exit 1 | ||
| fi | ||
| gh run download "$LAST_RUN_ID" --name notebooks --dir docs/notebooks | ||
| echo "::notice::Downloaded notebooks from build-docs run $LAST_RUN_ID" | ||
| - name: Setup doc deploy | ||
| run: | | ||
| git config --global user.name "github-actions[bot]" | ||
| git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| - name: Rebuild latest docs | ||
| run: uv run mike deploy --push --update-aliases ${{ env.VERSION }} latest | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.