Publish by @lnhsingh #202
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
name: Publish Documentation | |
run-name: Publish by @${{ github.actor }} | |
on: | |
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up Python 3.13 + uv | |
uses: "./.github/actions/uv_setup" | |
id: setup-python | |
with: | |
python-version: '3.13' | |
- name: Install dependencies | |
shell: bash | |
run: uv sync --group test | |
- name: Build documentation | |
run: make build | |
- name: Verify build output exists | |
run: | | |
if [ ! -d build ]; then | |
echo "Error: build/ directory was not created." | |
exit 1 | |
fi | |
- name: Prepare publish directory with nested build/ | |
run: | | |
mkdir public | |
cp -r ./build public/build | |
- name: Publish to prod branch under /build | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
# this token lets the Action push to prod | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# point to your generated site | |
publish_dir: ./public | |
# target branch (will be created if it doesn’t exist, or force‐updated if it does) | |
publish_branch: prod |