Skip to content

Commit b1c24f8

Browse files
committed
Update build workflow to use Docker for HTML validation and improve commit conditions
1 parent 15eb84d commit b1c24f8

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ jobs:
1919
run: npx respec --localhost --src index.html --out snapshot.html
2020

2121
- name: Validate HTML
22-
continue-on-error: true
2322
run: |
24-
npm install -g nu-html-checker
25-
nu-html-checker snapshot.html
23+
docker run --rm -v "$PWD:/site" ghcr.io/validator/validator:latest \
24+
vnu --errors-only --skip-non-html --format json /site/snapshot.html \
25+
| tee $CHECK_DIR/html-validation.json
26+
2627
2728
- name: Check for alternateFormats
2829
id: config
@@ -95,11 +96,13 @@ jobs:
9596
--buffer-size 8192 > $CHECK_DIR/link-check.txt 2>&1 || echo "Geen linkfouten gevonden." > $CHECK_DIR/link-check.txt
9697
9798
- name: Commit all results
98-
if: ${{ github.event_name == 'push' }}
99+
if: >
100+
github.event_name == 'push' &&
101+
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
99102
run: |
100103
git config user.name "github-actions[bot]"
101104
git config user.email "github-actions[bot]@users.noreply.github.com"
102-
105+
103106
if [[ "${{ steps.config.outputs.grep }}" == "true" ]] && ls static/*.pdf 1>/dev/null 2>&1; then
104107
mv static/*.pdf .
105108
fi
@@ -111,7 +114,9 @@ jobs:
111114
fi
112115
113116
git commit -m "Snapshot + checks gegenereerd" || echo "No changes to commit"
114-
git push --force-with-lease origin HEAD:main
117+
118+
BRANCH=${GITHUB_REF#refs/heads/}
119+
git push --force-with-lease origin HEAD:"$BRANCH"
115120
116121
- name: Upload snapshot artifact
117122
uses: actions/upload-artifact@v4

.github/workflows/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ name: Main Workflow
22
on:
33
push:
44
branches:
5-
- main
6-
- develop
5+
- '**'
76
pull_request:
87
release:
9-
types: [published]
8+
types: [published, prereleased]
109

1110
jobs:
1211
build:

0 commit comments

Comments
 (0)