forked from onnovalkering/brane
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): Publish documentation on GitHub pages
Currently this will redirect the root to the unstable (main) documentation. Once we do another stable release; I suggest we add an compiled artifact with the docs, so we can download and publish those as well.
- Loading branch information
1 parent
35166c3
commit 8de5bb9
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,50 @@ | ||
name: Deploy Rust Documentation to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust with dtolnay's toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
|
||
- name: Build Documentation | ||
run: | | ||
cargo doc --workspace --no-deps --document-private-items | ||
- name: Prepare Documentation for GitHub Pages | ||
run: | | ||
mkdir -p gh-pages/unstable | ||
cp -r target/doc/* gh-pages/unstable | ||
echo '<meta http-equiv="refresh" content="0; url=unstable/overview/index.html">' > gh-pages/index.html | ||
- name: Upload to GitHub Pages | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: gh-pages | ||
|
||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Deploy to GitHub Pages | ||
uses: actions/deploy-pages@v4 | ||
|