Update docs-ghpages.yml - 02 automate building rust docs and deploy to github pages

This commit is contained in:
Nagu Thogiti 2023-09-10 17:30:56 +08:00 committed by CPerezz
parent c66fafa814
commit 56325ea146
No known key found for this signature in database
GPG Key ID: 6EE573EDC452F806
1 changed files with 9 additions and 8 deletions

View File

@ -1,35 +1,37 @@
name: halo2 docs ghpages
# Host the docs on github pages
# Setup docs for ghpages
on:
push:
branches:
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Build latest rustdocs
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --workspace --all-features
args: --no-deps --all-features --workspace
env:
RUSTDOCFLAGS: -Z unstable-options --enable-index-page --cfg docsrs --html-in-header ${{ github.workspace }}/halo2_proofs/katex-header.html
- name: Create the required index page and move the latest rustdocs into docs
run: |
echo "<meta http-equiv=\"refresh\" content=\"0; url=build_wheel\">" > ./target/doc/index.html
mkdir -p ./docs
mv ./target/doc ./docs
rm -rf ./docs
cp -R ./target/doc ./docs
echo "<meta http-equiv=\"refresh\" content=\"0; url=pse_halo2\">" > ./docs/index.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
@ -37,4 +39,3 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs