Skip to content

Build

Build #182

Workflow file for this run

name: Build
# on:
# workflow_call:
on:
workflow_dispatch:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
jobs:
main:
name: Snapshot
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Verwijder oude docs-map
run: |
if [ -d "./docs" ]; then
git rm -r ./docs
else
echo "Map './docs' bestaat niet."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: mkdir ~/static
- name: Create cache
uses: actions/cache@v4
with:
path: ~/static
key: ${{ github.run_id }}
- name: Static HTML
run: |
npx respec --localhost --src index.html --out ~/static/snapshot.html
- name: Check config
id: config
if: ${{ github.event_name == 'push'}}
run: |
echo "grep=false" >> $GITHUB_OUTPUT
if grep -q alternateFormats ./js/config.js; then
echo "grep=true" >> $GITHUB_OUTPUT
fi
- run: mkdir ./docs
- name: PDF
run: |
cp ./js/config.js config.js
cp ~/static/snapshot.html snapshot.html
cp ~/static/snapshot.html ~/static/index.html
npm i puppeteer
python3 -m http.server 8080 &
wget https://raw.githubusercontent.com/Logius-standaarden/Automatisering/9d1e0512057b18cb92c39e5078ed93ee855926e7/scripts/pdf.js
rm -f *.pdf
node pdf.js
find *.pdf
mv *.pdf ~/static/
- name: Kopieer gegenereerde bestanden naar repository-map
run: cp -r ~/static/* ./docs/
- name: Commit en push gegenereerde bestanden
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add ./docs/
git commit -m "Automatisch gegenereerde bestanden toegevoegd" || echo "Geen wijzigingen om te committen"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}