mirror of
https://github.com/mailscope/kumomta.git
synced 2026-09-06 02:28:56 +00:00
ci: automate doc build and publish to gh_pages branch
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
name: pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "docs/**"
|
||||
- ".github/workflows/pages.yml"
|
||||
#schedule:
|
||||
# - cron: "50 * * * *"
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: "Install Rust"
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: "minimal"
|
||||
toolchain: "stable"
|
||||
default: true
|
||||
override: true
|
||||
components: "rustfmt"
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
key: ${{ runner.os }}-cargo-mdbook-${{ hashFiles('.github/workflows/pages.yml') }}
|
||||
- name: Install mdBook
|
||||
run: |
|
||||
(test -x ~/.cargo/bin/mdbook || (cd && cargo install mdbook --no-default-features --features search --vers "^0.4" --locked))
|
||||
- name: Install mdBook linkcheck
|
||||
run: |
|
||||
(test -x ~/.cargo/bin/mdbook-linkcheck || (cd && cargo install mdbook-linkcheck --locked))
|
||||
- name: Install mdBook mermaid
|
||||
run: |
|
||||
(test -x ~/.cargo/bin/mdbook-mermaid || (cd && cargo install mdbook-mermaid --locked))
|
||||
- name: Install gelatyx
|
||||
run: |
|
||||
(test -x ~/.cargo/bin/gelatyx || (cd && cargo install gelatyx --version "^0.2" --locked))
|
||||
- name: Build
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
source $HOME/.cargo/env
|
||||
./docs/build-docs.sh
|
||||
- name: Deploy
|
||||
if: success()
|
||||
uses: crazy-max/ghaction-github-pages@v3
|
||||
with:
|
||||
target_branch: gh-pages
|
||||
build_dir: gh_pages/html
|
||||
keep_history: true
|
||||
allow_empty_commit: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user