From 4fd057123fd46365fbbe1787e7255fb050bd8c0f Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Tue, 15 Aug 2023 15:18:46 +0200 Subject: [PATCH] Simplify and align workflow scripts --- .github/workflows/nodejs.yml | 12 +++--------- .github/workflows/pdf.yml | 4 ++-- package.json | 3 ++- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index fa72cacad..19df22148 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -27,14 +27,8 @@ jobs: npm run build git config user.name ${GITHUB_ACTOR} git config user.email ${PUSHER_EMAIL} - git add docs/index.md docs/*/*.html docs/*/*.md docs/*/styles/* - for dir in docs/*/ # list directories in the form "docs/dirname/" - do - doc=${dir%/} # remove the trailing "/" - doc=${doc##*/} # retain everything after the final "/" - git diff-index --quiet HEAD $dir/*.html $dir/styles/* || npm run pdf $doc - done - git add docs/*/*.pdf - git diff-index --quiet HEAD docs/* || ( git commit -m "auto-refreshed" && git push ) + git add docs/* + git diff-index --quiet HEAD docs/* || git commit -m "auto-refreshed" + git push env: PUSHER_EMAIL: ${{ github.event.pusher.email }} diff --git a/.github/workflows/pdf.yml b/.github/workflows/pdf.yml index 1bf3b6fb8..27993223b 100644 --- a/.github/workflows/pdf.yml +++ b/.github/workflows/pdf.yml @@ -21,9 +21,9 @@ jobs: - name: Generate PDF run: | npm ci - npm run pdf --if-present + npm run pdf git config user.name ${GITHUB_ACTOR} git config user.email github-actions@github.com git add docs/*/*.pdf - git diff-index --quiet HEAD || git commit -m "PDF generation" + git diff-index --quiet HEAD docs/*/*.pdf || git commit -m "PDF generation" git push diff --git a/package.json b/package.json index c51745280..3e6fdd7af 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "", "main": "number.js", "scripts": { - "build": "node lib/build", + "build": "npm run html && npm run pdf", + "html": "node lib/build", "pdf": "node lib/build-pdf.js", "start": "node lib/server", "test": "c8 -r html -r text mocha",