From eb147e5f235c1eb8e1d7f57031d9711bc5d31f8e Mon Sep 17 00:00:00 2001 From: Nagu Thogiti Date: Sun, 10 Sep 2023 07:42:41 +0800 Subject: [PATCH 1/4] Create docs-ghpages.yml --- .github/workflows/docs-ghpages.yml | 52 ++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/docs-ghpages.yml diff --git a/.github/workflows/docs-ghpages.yml b/.github/workflows/docs-ghpages.yml new file mode 100644 index 0000000000..88863b8b5a --- /dev/null +++ b/.github/workflows/docs-ghpages.yml @@ -0,0 +1,52 @@ +name: halo2 docs ghpages +# Setup docs for ghpages + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + + + - name: Install mdbook-katex and mdbook-pdf + uses: actions-rs/cargo@v1 + with: + command: install + args: mdbook-katex mdbook-pdf + + - name: Install mdbook-pdf-outline + run: pip3 install mdbook-pdf-outline + + - name: Build halo2 book + run: mdbook build book/ + + - name: Build latest rustdocs + uses: actions-rs/cargo@v1 + with: + command: doc + args: --no-deps --workspace --all-features + 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 "" > ./target/doc/index.html + mkdir -p ./docs + mv ./target/doc ./docs + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs + + From 85f2f279d3337c4a706a31bcc041dee3e19ac1d7 Mon Sep 17 00:00:00 2001 From: Nagu Thogiti Date: Sun, 10 Sep 2023 08:45:24 +0800 Subject: [PATCH 2/4] Host docs on ghpages - Added a github action workflow --- .github/workflows/docs-ghpages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs-ghpages.yml b/.github/workflows/docs-ghpages.yml index 88863b8b5a..20d3570e62 100644 --- a/.github/workflows/docs-ghpages.yml +++ b/.github/workflows/docs-ghpages.yml @@ -1,5 +1,5 @@ name: halo2 docs ghpages -# Setup docs for ghpages +# Host the docs on github pages on: push: From c66fafa8147b9ed17d5d1e26c669561159d44d9a Mon Sep 17 00:00:00 2001 From: Nagu Thogiti Date: Sun, 10 Sep 2023 09:03:31 +0800 Subject: [PATCH 3/4] Update docs-ghpages.yml --- .github/workflows/docs-ghpages.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/docs-ghpages.yml b/.github/workflows/docs-ghpages.yml index 20d3570e62..13035e59d3 100644 --- a/.github/workflows/docs-ghpages.yml +++ b/.github/workflows/docs-ghpages.yml @@ -17,18 +17,6 @@ jobs: override: true - - name: Install mdbook-katex and mdbook-pdf - uses: actions-rs/cargo@v1 - with: - command: install - args: mdbook-katex mdbook-pdf - - - name: Install mdbook-pdf-outline - run: pip3 install mdbook-pdf-outline - - - name: Build halo2 book - run: mdbook build book/ - - name: Build latest rustdocs uses: actions-rs/cargo@v1 with: From 56325ea14683b0efe87e0277cd81fc85ee7e07cf Mon Sep 17 00:00:00 2001 From: Nagu Thogiti Date: Sun, 10 Sep 2023 17:30:56 +0800 Subject: [PATCH 4/4] Update docs-ghpages.yml - 02 automate building rust docs and deploy to github pages --- .github/workflows/docs-ghpages.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docs-ghpages.yml b/.github/workflows/docs-ghpages.yml index 13035e59d3..25d964c9c7 100644 --- a/.github/workflows/docs-ghpages.yml +++ b/.github/workflows/docs-ghpages.yml @@ -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 "" > ./target/doc/index.html - mkdir -p ./docs - mv ./target/doc ./docs + rm -rf ./docs + cp -R ./target/doc ./docs + echo "" > ./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 -