Update docs and add a check in PoB (#11) #45
This file contains hidden or 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
| name: Deploy Documentation to Pages | |
| on: | |
| push: | |
| branches: ["main", "katex"] | |
| paths: | |
| - "dart-bp/docs/**" | |
| - "dart-bp/src/**" | |
| - ".github/workflows/deploy-docs.yml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Build HTML documentation | |
| run: | | |
| cd dart-bp | |
| make doc | |
| env: | |
| CARGO_TERM_COLOR: always | |
| - name: Build PDF with TeXLive | |
| uses: xu-cheng/texlive-action@v3 | |
| with: | |
| run: | | |
| apk add --no-cache pandoc | |
| cd dart-bp/docs | |
| ./build-pdf.sh | |
| - name: Copy PDF to doc directory | |
| run: | | |
| cp dart-bp/docs/dart-bp-specification.pdf target/doc/ | |
| echo "✓ PDF generated at target/doc/dart-bp-specification.pdf" | |
| ls -lh target/doc/dart-bp-specification.pdf | |
| - name: Add root redirect | |
| run: | | |
| echo '<meta http-equiv="refresh" content="0; url=polymesh_dart_bp/documentation/index.html">' > target/doc/index.html | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./target/doc | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |