ci(docs): merge man-page and html-docs workflows into build-docs
Both workflows triggered on the same path change, installed pandoc separately, and raced to commit — the second always failed on push due to new commits from the first. A single job installs pandoc once, generates both outputs, and commits them together.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
name: Generate documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "docs/fish-config.md"
|
||||
|
||||
jobs:
|
||||
build-docs:
|
||||
runs-on: racknerd-mini
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
- name: Install pandoc
|
||||
run: sudo apt-get update -qq && sudo apt-get install -y pandoc
|
||||
|
||||
- name: Compile man page
|
||||
run: |
|
||||
pandoc --standalone \
|
||||
--from markdown \
|
||||
--to man \
|
||||
docs/fish-config.md \
|
||||
-o docs/fish-config.1
|
||||
|
||||
- name: Generate chunked HTML docs
|
||||
run: |
|
||||
rm -rf docs/html/
|
||||
pandoc -f gfm -t chunkedhtml --split-level=1 --toc \
|
||||
--include-in-header docs/html-style.html \
|
||||
docs/fish-config.md \
|
||||
-o docs/html/
|
||||
|
||||
- name: Commit generated docs
|
||||
run: |
|
||||
git config user.name "Gitea Actions"
|
||||
git config user.email "actions@gitea"
|
||||
git add docs/fish-config.1 docs/html/
|
||||
git diff --cached --quiet && echo "No changes to commit" && exit 0
|
||||
git commit -m "chore(docs): regenerate man page and HTML docs"
|
||||
git push
|
||||
Reference in New Issue
Block a user