Skip to content

Commit

Permalink
chore(ci): Publish documentation on GitHub pages
Browse files Browse the repository at this point in the history
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
DanielVoogsgerd committed Oct 28, 2024
1 parent 35166c3 commit 8de5bb9
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/docs.yml
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

0 comments on commit 8de5bb9

Please sign in to comment.