Skip to content

Commit

Permalink
Generate documentation per-release
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity authored Oct 21, 2023
1 parent c3d783c commit 4e5c717
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
workflow_dispatch:
push:
branches: [main]
tags: [v*]

jobs:
deploy:
Expand All @@ -14,6 +15,7 @@ jobs:
with:
fetch-depth: 0
submodules: true
ref: ${{ github.event.release.tag_name || 'main' }}
- name: Setup Rust
uses: ATiltedTree/setup-rust@v1
with:
Expand All @@ -34,8 +36,17 @@ jobs:
else
echo "Docs folder not found."
fi
- name: Prepare Deploy Folder
run: |
mkdir -p deploy
if [[ $GITHUB_REF == refs/heads/main ]]; then
mv docs/book deploy/
else
version=${GITHUB_REF#refs/tags/v}
mv docs/book deploy/$version
fi
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/book
folder: deploy
single-commit: true

0 comments on commit 4e5c717

Please sign in to comment.