Adds the URL rules to the preview server, IIS config and deploy
The preview server and web.config now follow the same URLs as nginx, without the SPA fallback. Lighthouse exceptions need a recorded reason and the 404 page is audited through an opt-in route. The deploy checks the build first and the served result afterwards. The IIS rules stay unverified until a host exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -119,6 +119,10 @@ jobs:
|
||||
name: dist
|
||||
path: web/dist
|
||||
|
||||
# Alleen de clientmap hoort online: geen servermap, geen source maps
|
||||
- name: Controle van de build
|
||||
run: bash deploy/check-artifact.sh dist
|
||||
|
||||
# Eenvoudig: de testmap leegmaken en de nieuwe build erin zetten. Oude
|
||||
# versies worden niet bewaard. Op de Pi draait ook de huidige
|
||||
# WordPress-site; daarom weigert deze stap een lege variabele, '/', of
|
||||
@@ -151,14 +155,16 @@ jobs:
|
||||
sshpass -e scp -P "$SSH_PORT" -o StrictHostKeyChecking=accept-new -r dist/* "$SSH_USER@$SSH_HOST:$DEPLOY_PATH/"
|
||||
echo "Gedeployd naar test: ${GITHUB_REF_NAME} (${GITHUB_SHA::7})"
|
||||
|
||||
# Vergelijkt wat de server teruggeeft met dist. Met de oude nginx-config
|
||||
# (homepage voor elk pad) wordt deze stap rood: de nieuwe config moet er
|
||||
# dus staan voor de deploy (zie pi-install-instructions.md).
|
||||
- name: Controle na deploy
|
||||
env:
|
||||
HEALTH_URL: ${{ vars.HEALTH_CHECK_URL_TEST }}
|
||||
run: |
|
||||
if [ -z "$HEALTH_URL" ]; then echo "Geen HEALTH_CHECK_URL_TEST ingesteld; overgeslagen"; exit 0; fi
|
||||
curl -fsS -o /dev/null --retry 5 --retry-delay 3 "$HEALTH_URL"
|
||||
curl -fsSI "$HEALTH_URL" | grep -qi '^content-security-policy:'
|
||||
echo "Test bereikbaar met security headers"
|
||||
bash deploy/verify-deployment.sh "$HEALTH_URL" dist --test
|
||||
echo "Test bereikbaar en gelijk aan de build"
|
||||
|
||||
# Lighthouse tegen de gebouwde site (mobiel en desktop)
|
||||
lighthouse:
|
||||
@@ -266,12 +272,11 @@ jobs:
|
||||
name: dist
|
||||
path: web/dist
|
||||
|
||||
- name: IIS-configuratie toevoegen
|
||||
run: cp deploy/iis/web.config dist/web.config
|
||||
|
||||
# FTP met TLS (verplicht) naar de webhoster. Eerst alle bestanden behalve
|
||||
# index.html, dan index.html, en pas daarna oude bestanden opruimen. Zo
|
||||
# FTP met TLS (verplicht) naar de webhoster, in drie rondes (zie
|
||||
# deploy/upload-production.sh): eerst alles behalve HTML en web.config,
|
||||
# dan web.config en alle HTML, en pas daarna oude bestanden opruimen. Zo
|
||||
# verwijst een bezoeker nooit naar een bestand dat er nog niet staat.
|
||||
# Deze job kan pas draaien als er een webhost is.
|
||||
- name: Upload naar productie (FTPS)
|
||||
env:
|
||||
FTP_HOST: ${{ secrets.FTP_HOST }}
|
||||
@@ -280,14 +285,7 @@ jobs:
|
||||
FTP_DIR: ${{ vars.FTP_REMOTE_DIR || 'wwwroot' }}
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y lftp
|
||||
lftp --env-password -u "$FTP_USER" "$FTP_HOST" -e "
|
||||
set ftp:ssl-force true;
|
||||
set ftp:ssl-protect-data true;
|
||||
set net:max-retries 3;
|
||||
mirror --reverse --verbose --exclude-glob index.html dist/ $FTP_DIR/;
|
||||
put -O $FTP_DIR dist/index.html;
|
||||
mirror --reverse --delete --verbose dist/ $FTP_DIR/;
|
||||
quit"
|
||||
bash deploy/upload-production.sh dist "$FTP_DIR"
|
||||
echo "Gedeployd naar productie: ${GITHUB_REF_NAME} (${GITHUB_SHA::7})"
|
||||
|
||||
- name: Controle na deploy
|
||||
@@ -295,6 +293,5 @@ jobs:
|
||||
HEALTH_URL: ${{ vars.HEALTH_CHECK_URL_PRODUCTION }}
|
||||
run: |
|
||||
if [ -z "$HEALTH_URL" ]; then echo "Geen HEALTH_CHECK_URL_PRODUCTION ingesteld; overgeslagen"; exit 0; fi
|
||||
curl -fsS -o /dev/null --retry 5 --retry-delay 3 "$HEALTH_URL"
|
||||
curl -fsSI "$HEALTH_URL" | grep -qi '^content-security-policy:'
|
||||
echo "Productie bereikbaar met security headers"
|
||||
bash deploy/verify-deployment.sh "$HEALTH_URL" dist
|
||||
echo "Productie bereikbaar en gelijk aan de build"
|
||||
|
||||
Reference in New Issue
Block a user