Skip to content

Build and Deploy Tutorial #56

Build and Deploy Tutorial

Build and Deploy Tutorial #56

Workflow file for this run

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