62 lines
1.5 KiB
YAML
62 lines
1.5 KiB
YAML
name: 'docs-publish'
|
|
on:
|
|
push:
|
|
branches: [ rel-* ]
|
|
paths:
|
|
- 'docs/**'
|
|
workflow_dispatch:
|
|
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
# Allow one concurrent deployment
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-and-publish:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Determine latest rel-x.y branch
|
|
id: latest
|
|
run: |
|
|
latest_branch=$(git branch -r \
|
|
| sed 's|origin/||' \
|
|
| grep '^rel-[0-9]\+\.[0-9]\+$' \
|
|
| sed 's/rel-//' \
|
|
| sort -V \
|
|
| tail -n 1)
|
|
echo "latest=rel-$latest_branch" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Stop if not latest
|
|
if: steps.latest.outputs.latest != github.ref_name
|
|
run: |
|
|
echo "Not latest branch. This is ${{ github.ref_name }}, latest is ${{ steps.latest.outputs.latest }}"
|
|
exit 0
|
|
- name: Setup bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: latest
|
|
- name: Install dependencies
|
|
run: bun install
|
|
- name: Build docs
|
|
run:
|
|
bun docs-build
|
|
- name: Setup Pages
|
|
uses: actions/configure-pages@v5
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
# Upload entire repository
|
|
path: './build'
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|
|
|