Skip to content

Commit

Permalink
Simplify and align workflow scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfhandl committed Aug 15, 2023
1 parent 68bafd2 commit 4fd0571
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
4 changes: 2 additions & 2 deletions .github/workflows/pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4fd0571

Please sign in to comment.