CI: nieuwe namen voor secrets en variabelen, SSH alleen met sleutel (geen sshpass), ASF-testdeploy zonder schakelaar
Continuous Integration / config-sls (pull_request) Successful in 6s
Continuous Integration / changes (pull_request) Successful in 12s
Continuous Integration / config-asf (pull_request) Successful in 5s
Continuous Integration / compile-sites (pull_request) Successful in 1m12s
Continuous Integration / frontend-prepare (pull_request) Successful in 34s
Continuous Integration / vulnerability-scan (pull_request) Successful in 1m13s
Continuous Integration / frontend-build (pull_request) Successful in 41s
Continuous Integration / backend-build (pull_request) Successful in 1m11s
Continuous Integration / frontend-lint (pull_request) Successful in 41s
Continuous Integration / frontend-test (pull_request) Successful in 2m56s
Continuous Integration / backend-test (pull_request) Successful in 3m59s
Continuous Integration / publish-sls-test (pull_request) Skipped
Continuous Integration / publish-sls-production (pull_request) Skipped
Continuous Integration / deploy-sls-test (pull_request) Skipped
Continuous Integration / deploy-sls-production (pull_request) Skipped
Continuous Integration / publish-asf-test (pull_request) Skipped
Continuous Integration / deploy-asf-test (pull_request) Skipped
Continuous Integration / smoke-sls-test (pull_request) Skipped
Continuous Integration / smoke-asf-test (pull_request) Skipped

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 20:22:31 +01:00
co-authored by Claude Sonnet 5.5
parent b4294d5419
commit df488663bd
4 changed files with 123 additions and 135 deletions
+50 -51
View File
@@ -42,12 +42,12 @@ env:
ARTIFACT_NAME_SLS_PRODUCTION: app-sls-production
DEPLOY_ENVIRONMENT_SLS_TEST: test
DEPLOY_ENVIRONMENT_SLS_PRODUCTION: production
DEPLOY_PATH_TEST: ${{ vars.DEPLOY_PATH_TEST }}
DEPLOY_PATH_PRODUCTION: ${{ vars.DEPLOY_PATH_PRODUCTION }}
SERVICE_NAME_TEST: ${{ vars.SERVICE_NAME_TEST }}
SERVICE_NAME_PRODUCTION: ${{ vars.SERVICE_NAME_PRODUCTION }}
HEALTH_CHECK_URL_TEST: ${{ vars.HEALTH_CHECK_URL_TEST }}
HEALTH_CHECK_URL_PRODUCTION: ${{ vars.HEALTH_CHECK_URL_PRODUCTION }}
DEPLOY_PATH_TEST: ${{ vars.SLS_TEST_DEPLOY_PATH }}
DEPLOY_PATH_PRODUCTION: ${{ vars.SLS_PROD_DEPLOY_PATH }}
SERVICE_NAME_TEST: ${{ vars.SLS_TEST_SERVICE_NAME }}
SERVICE_NAME_PRODUCTION: ${{ vars.SLS_PROD_SERVICE_NAME }}
HEALTH_CHECK_URL_TEST: ${{ vars.SLS_TEST_HEALTH_URL }}
HEALTH_CHECK_URL_PRODUCTION: ${{ vars.SLS_PROD_HEALTH_URL }}
jobs:
# Passes the env: values above through as job outputs, since the env context is unavailable in
@@ -78,16 +78,16 @@ jobs:
# step-level env works on both runners. The test trio must be set, otherwise fail here instead of in the deploy.
- id: set
env:
DEPLOY_PATH_TEST: ${{ vars.DEPLOY_PATH_TEST }}
DEPLOY_PATH_PRODUCTION: ${{ vars.DEPLOY_PATH_PRODUCTION }}
SERVICE_NAME_TEST: ${{ vars.SERVICE_NAME_TEST }}
SERVICE_NAME_PRODUCTION: ${{ vars.SERVICE_NAME_PRODUCTION }}
HEALTH_CHECK_URL_TEST: ${{ vars.HEALTH_CHECK_URL_TEST }}
HEALTH_CHECK_URL_PRODUCTION: ${{ vars.HEALTH_CHECK_URL_PRODUCTION }}
DEPLOY_PATH_TEST: ${{ vars.SLS_TEST_DEPLOY_PATH }}
DEPLOY_PATH_PRODUCTION: ${{ vars.SLS_PROD_DEPLOY_PATH }}
SERVICE_NAME_TEST: ${{ vars.SLS_TEST_SERVICE_NAME }}
SERVICE_NAME_PRODUCTION: ${{ vars.SLS_PROD_SERVICE_NAME }}
HEALTH_CHECK_URL_TEST: ${{ vars.SLS_TEST_HEALTH_URL }}
HEALTH_CHECK_URL_PRODUCTION: ${{ vars.SLS_PROD_HEALTH_URL }}
run: |
for v in DEPLOY_PATH_TEST SERVICE_NAME_TEST HEALTH_CHECK_URL_TEST; do
if [ -z "${!v}" ]; then
echo "The Gitea variable $v is empty or not set on this runner; the deploy would use an empty path."
echo "The value for $v (a SLS_TEST_* Gitea variable) is empty or not set on this runner; the deploy would use an empty path."
exit 1
fi
done
@@ -418,11 +418,11 @@ jobs:
version: ${{ env.PNPM_VERSION }}
- name: Verify Umami origin is permitted (REF-U5-01)
if: ${{ vars.VITE_UMAMI_SCRIPT_URL != '' }}
if: ${{ vars.SLS_TEST_UMAMI_SCRIPT_URL != '' }}
run: |
ORIGIN=$(echo "${{ vars.VITE_UMAMI_SCRIPT_URL }}" | sed -E 's#^(https?://[^/]+).*#\1#')
if ! echo ",${{ vars.SECURITY_ALLOWED_SCRIPT_ORIGINS_TEST }}," | grep -qF ",$ORIGIN,"; then
echo "Umami origin '$ORIGIN' is not present in the SECURITY_ALLOWED_SCRIPT_ORIGINS_TEST Gitea variable."
ORIGIN=$(echo "${{ vars.SLS_TEST_UMAMI_SCRIPT_URL }}" | sed -E 's#^(https?://[^/]+).*#\1#')
if ! echo ",${{ vars.SLS_TEST_SECURITY_ALLOWED_SCRIPT_ORIGINS }}," | grep -qF ",$ORIGIN,"; then
echo "Umami origin '$ORIGIN' is not present in the SLS_TEST_SECURITY_ALLOWED_SCRIPT_ORIGINS Gitea variable."
echo "Fix the variable, or the test environment's SecurityHeaders CSP config it must mirror (D-16)."
exit 1
fi
@@ -441,9 +441,9 @@ jobs:
VITE_APP_ENV: test
VITE_APP_TITLE: SLP Software
VITE_THEME: slpsoftware
VITE_UMAMI_SCRIPT_URL: ${{ vars.VITE_UMAMI_SCRIPT_URL }}
VITE_UMAMI_WEBSITE_ID: ${{ vars.VITE_UMAMI_WEBSITE_ID_TEST }}
VITE_SENTRY_DSN: ${{ vars.VITE_SENTRY_DSN }}
VITE_UMAMI_SCRIPT_URL: ${{ vars.SLS_TEST_UMAMI_SCRIPT_URL }}
VITE_UMAMI_WEBSITE_ID: ${{ vars.SLS_TEST_UMAMI_WEBSITE_ID }}
VITE_SENTRY_DSN: ${{ vars.SLS_TEST_SENTRY_DSN }}
run: |
pnpm install --frozen-lockfile
pnpm build
@@ -496,11 +496,11 @@ jobs:
version: ${{ env.PNPM_VERSION }}
- name: Verify Umami origin is permitted (REF-U5-01)
if: ${{ vars.VITE_UMAMI_SCRIPT_URL != '' }}
if: ${{ vars.SLS_PROD_UMAMI_SCRIPT_URL != '' }}
run: |
ORIGIN=$(echo "${{ vars.VITE_UMAMI_SCRIPT_URL }}" | sed -E 's#^(https?://[^/]+).*#\1#')
if ! echo ",${{ vars.SECURITY_ALLOWED_SCRIPT_ORIGINS_PRODUCTION }}," | grep -qF ",$ORIGIN,"; then
echo "Umami origin '$ORIGIN' is not present in the SECURITY_ALLOWED_SCRIPT_ORIGINS_PRODUCTION Gitea variable."
ORIGIN=$(echo "${{ vars.SLS_PROD_UMAMI_SCRIPT_URL }}" | sed -E 's#^(https?://[^/]+).*#\1#')
if ! echo ",${{ vars.SLS_PROD_SECURITY_ALLOWED_SCRIPT_ORIGINS }}," | grep -qF ",$ORIGIN,"; then
echo "Umami origin '$ORIGIN' is not present in the SLS_PROD_SECURITY_ALLOWED_SCRIPT_ORIGINS Gitea variable."
echo "Fix the variable, or the production environment's SecurityHeaders CSP config it must mirror (D-16)."
exit 1
fi
@@ -513,9 +513,9 @@ jobs:
VITE_APP_ENV: production
VITE_APP_TITLE: SLP Software
VITE_THEME: slpsoftware
VITE_UMAMI_SCRIPT_URL: ${{ vars.VITE_UMAMI_SCRIPT_URL }}
VITE_UMAMI_WEBSITE_ID: ${{ vars.VITE_UMAMI_WEBSITE_ID_PRODUCTION }}
VITE_SENTRY_DSN: ${{ vars.VITE_SENTRY_DSN }}
VITE_UMAMI_SCRIPT_URL: ${{ vars.SLS_PROD_UMAMI_SCRIPT_URL }}
VITE_UMAMI_WEBSITE_ID: ${{ vars.SLS_PROD_UMAMI_WEBSITE_ID }}
VITE_SENTRY_DSN: ${{ vars.SLS_PROD_SENTRY_DSN }}
run: |
pnpm install --frozen-lockfile
pnpm build
@@ -549,11 +549,12 @@ jobs:
uses: ./.gitea/workflows/deploy-scp.yaml
secrets: inherit
with:
host: SLS_TEST
artifact_name: ${{ needs.config-sls.outputs.artifact_name_sls_test }}
environment: ${{ needs.config-sls.outputs.deploy_environment_sls_test }}
deploy_path: ${{ vars.DEPLOY_PATH_TEST }}
service_name: ${{ vars.SERVICE_NAME_TEST }}
health_check_url: ${{ vars.HEALTH_CHECK_URL_TEST }}
deploy_path: ${{ vars.SLS_TEST_DEPLOY_PATH }}
service_name: ${{ vars.SLS_TEST_SERVICE_NAME }}
health_check_url: ${{ vars.SLS_TEST_HEALTH_URL }}
run_db_backup: false
# Production deploy ONLY on an explicit workflow_dispatch run with deploy_sls_production checked, and
@@ -566,11 +567,12 @@ jobs:
uses: ./.gitea/workflows/deploy-scp.yaml
secrets: inherit
with:
host: SLS_PROD
artifact_name: ${{ needs.config-sls.outputs.artifact_name_sls_production }}
environment: ${{ needs.config-sls.outputs.deploy_environment_sls_production }}
deploy_path: ${{ vars.DEPLOY_PATH_PRODUCTION }}
service_name: ${{ vars.SERVICE_NAME_PRODUCTION }}
health_check_url: ${{ vars.HEALTH_CHECK_URL_PRODUCTION }}
deploy_path: ${{ vars.SLS_PROD_DEPLOY_PATH }}
service_name: ${{ vars.SLS_PROD_SERVICE_NAME }}
health_check_url: ${{ vars.SLS_PROD_HEALTH_URL }}
run_db_backup: true
# ==========================================================================================
@@ -578,15 +580,12 @@ jobs:
# SlpSoftware jobs, the env block, deploy-scp.yaml) is changed, a failure here never blocks the
# SlpSoftware deploy and vice versa.
#
# Everything below is switched on by ONE Gitea variable, ASF_TEST_DEPLOY_ENABLED == 'true'.
# While it is unset (or anything else) all three jobs are skipped and the pipeline behaves
# exactly as before. Secrets cannot be tested in an `if:`, hence an explicit variable; it is set
# only after the Pi and the other ASF_* variables exist.
# No switch: the ASF test deploy runs like the SlpSoftware one. The Gitea variables ASF_TEST_DEPLOY_PATH,
# ASF_TEST_SERVICE_NAME and ASF_TEST_HEALTH_URL and the secrets ASF_TEST_HOST_* must exist; config-asf fails clearly if not.
# Runs: on every push to master (like the SlpSoftware test deploy) or manually with the
# "Deploy ASF test" box ticked. Test only: there is no production path for ASF.
# ==========================================================================================
config-asf:
if: ${{ vars.ASF_TEST_DEPLOY_ENABLED == 'true' }}
runs-on: linux
outputs:
deploy_path: ${{ steps.set.outputs.deploy_path }}
@@ -595,13 +594,13 @@ jobs:
steps:
- id: set
env:
DEPLOY_PATH: ${{ vars.DEPLOY_PATH_ASF_TEST }}
SERVICE_NAME: ${{ vars.SERVICE_NAME_ASF_TEST }}
HEALTH_CHECK_URL: ${{ vars.HEALTH_CHECK_URL_ASF_TEST }}
DEPLOY_PATH: ${{ vars.ASF_TEST_DEPLOY_PATH }}
SERVICE_NAME: ${{ vars.ASF_TEST_SERVICE_NAME }}
HEALTH_CHECK_URL: ${{ vars.ASF_TEST_HEALTH_URL }}
run: |
for v in DEPLOY_PATH SERVICE_NAME HEALTH_CHECK_URL; do
if [ -z "${!v}" ]; then
echo "The Gitea variable for $v (…_ASF_TEST) is not set; set it or switch ASF_TEST_DEPLOY_ENABLED off."
echo "The Gitea variable for $v (ASF_TEST_*) is not set."
exit 1
fi
done
@@ -612,10 +611,9 @@ jobs:
publish-asf-test:
needs: [changes, backend-build, backend-test, vulnerability-scan, frontend-build, frontend-test, frontend-lint]
# Same gate handling as publish-sls-test (see there for why always() and explicit results), plus the
# ASF switch, and built only when it will actually be deployed.
# fact that it is built only when it will actually be deployed.
if: |
always() &&
vars.ASF_TEST_DEPLOY_ENABLED == 'true' &&
needs.changes.result == 'success' &&
needs.backend-build.result != 'failure' && needs.backend-build.result != 'cancelled' &&
needs.backend-test.result != 'failure' && needs.backend-test.result != 'cancelled' &&
@@ -648,7 +646,7 @@ jobs:
VITE_APP_TITLE: Andrea Slop Fotografie
VITE_THEME: asf
VITE_DEFAULT_LANGUAGE: nl
VITE_SENTRY_DSN: ${{ vars.VITE_SENTRY_DSN_ASF }}
VITE_SENTRY_DSN: ${{ vars.ASF_TEST_SENTRY_DSN }}
run: |
pnpm install --frozen-lockfile
pnpm build
@@ -672,15 +670,16 @@ jobs:
# here the deploy account name in the path, arrives empty). config-asf still validates that they are set.
deploy-asf-test:
needs: [publish-asf-test, config-asf]
if: vars.ASF_TEST_DEPLOY_ENABLED == 'true' && ((github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_asf_test == 'true') || (github.event_name == 'push' && github.ref == 'refs/heads/master'))
if: ((github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_asf_test == 'true') || (github.event_name == 'push' && github.ref == 'refs/heads/master'))
uses: ./.gitea/workflows/deploy-scp.yaml
secrets: inherit
with:
host: ASF_TEST
artifact_name: app-asf-test
environment: test
deploy_path: ${{ vars.DEPLOY_PATH_ASF_TEST }}
service_name: ${{ vars.SERVICE_NAME_ASF_TEST }}
health_check_url: ${{ vars.HEALTH_CHECK_URL_ASF_TEST }}
deploy_path: ${{ vars.ASF_TEST_DEPLOY_PATH }}
service_name: ${{ vars.ASF_TEST_SERVICE_NAME }}
health_check_url: ${{ vars.ASF_TEST_HEALTH_URL }}
run_db_backup: false
# --- Smoke tests of the deployed compositions (anonymous requests, see scripts/smoke-site.sh) ---
@@ -694,7 +693,7 @@ jobs:
- uses: actions/checkout@v4
- name: Smoke test SLS test
env:
HEALTH_URL: ${{ vars.HEALTH_CHECK_URL_TEST }}
HEALTH_URL: ${{ vars.SLS_TEST_HEALTH_URL }}
run: bash scripts/smoke-site.sh "$HEALTH_URL" sls-test
smoke-asf-test:
@@ -705,5 +704,5 @@ jobs:
- uses: actions/checkout@v4
- name: Smoke test ASF test
env:
HEALTH_URL: ${{ vars.HEALTH_CHECK_URL_ASF_TEST }}
HEALTH_URL: ${{ vars.ASF_TEST_HEALTH_URL }}
run: bash scripts/smoke-site.sh "$HEALTH_URL" asf-test