Build and Deploy Tutorial #56
Workflow file for this run
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: Build and Deploy Tutorial | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths: | |
| - 'Cargo.toml' | |
| - 'doc/**' | |
| workflow_dispatch: | |
| permissions: | |
| contents: "write" | |
| jobs: | |
| adoc_build: | |
| runs-on: ubuntu-latest | |
| name: Build and deploy GH pages | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install cargo-get | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: cargo-get | |
| - name: Get version | |
| id: pa_version | |
| run: echo "VERSION=$(cargo get package.version)" >> $GITHUB_OUTPUT | |
| - name: Build HTML Tutorial | |
| uses: tonynv/asciidoctor-action@master | |
| with: | |
| program: "asciidoctor -a version=${{ steps.pa_version.outputs.version }} -a source-highlighter=pygments -D doc/target/site --backend=html5 -o index.html doc/tutorial.adoc" | |
| - name: Build HTML Man Page | |
| uses: tonynv/asciidoctor-action@master | |
| with: | |
| program: "asciidoctor -a version=${{ steps.pa_version.outputs.version }} -a source-highlighter=pygments -D doc/target/site --backend=html5 -o parseargs-man.html doc/parseargs.1.adoc" | |
| - name: Deploy docs to ghpages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_branch: gh-pages | |
| publish_dir: ./doc/target/site | |