From a9ce4b9ada7bcb217a1c3c6526cb228a25793575 Mon Sep 17 00:00:00 2001 From: rootiest Date: Mon, 8 Jun 2026 15:36:31 -0400 Subject: [PATCH] ci(docs): merge man-page and html-docs workflows into build-docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../{man-page.yml => build-docs.yml} | 18 +++++--- .gitea/workflows/html-docs.yml | 41 ------------------- 2 files changed, 13 insertions(+), 46 deletions(-) rename .gitea/workflows/{man-page.yml => build-docs.yml} (61%) delete mode 100644 .gitea/workflows/html-docs.yml diff --git a/.gitea/workflows/man-page.yml b/.gitea/workflows/build-docs.yml similarity index 61% rename from .gitea/workflows/man-page.yml rename to .gitea/workflows/build-docs.yml index bef3170..7b3cab8 100644 --- a/.gitea/workflows/man-page.yml +++ b/.gitea/workflows/build-docs.yml @@ -1,4 +1,4 @@ -name: Generate man page +name: Generate documentation on: push: @@ -8,7 +8,7 @@ on: - "docs/fish-config.md" jobs: - build-manpage: + build-docs: runs-on: racknerd-mini steps: - name: Checkout @@ -27,11 +27,19 @@ jobs: docs/fish-config.md \ -o docs/fish-config.1 - - name: Commit man page + - 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 + 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 fish-config.1 man page" + git commit -m "chore(docs): regenerate man page and HTML docs" git push diff --git a/.gitea/workflows/html-docs.yml b/.gitea/workflows/html-docs.yml deleted file mode 100644 index 5e67c2e..0000000 --- a/.gitea/workflows/html-docs.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Generate HTML docs - -on: - push: - branches: - - main - paths: - - "docs/fish-config.md" - -jobs: - build-html-docs: - runs-on: racknerd-mini - steps: - - name: Checkout - env: - TOKEN: ${{ secrets.GITEA_TOKEN }} - run: | - HOST="${GITHUB_SERVER_URL#*://}" - SCHEME="${GITHUB_SERVER_URL%%://*}" - git clone --depth=1 --branch "${GITHUB_REF_NAME}" \ - "${SCHEME}://oauth2:${TOKEN}@${HOST}/${GITHUB_REPOSITORY}.git" . - - - name: Install pandoc - run: sudo apt-get update -qq && sudo apt-get install -y pandoc - - - 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 HTML docs - run: | - git config user.name "Gitea Actions" - git config user.email "actions@gitea" - git add docs/html/ - git diff --cached --quiet && echo "No changes to commit" && exit 0 - git commit -m "chore(docs): regenerate offline HTML docs" - git push