CI: jobnamen {actie}-{site}-{omgeving} (config-sls, publish/deploy-sls-test/-production); docs en merge-checklist bijgewerkt
Inputs (deploy_test, deploy_production, deploy_asf_test) en config-outputs ongewijzigd. Branch protection: vereiste check publish-test (pull_request) moet publish-sls-test (pull_request) worden. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,7 +22,7 @@ on:
|
||||
|
||||
# A new push to the same PR does not cancel an already-running CI attempt by default (each
|
||||
# `synchronize` event starts an independent run) — this opts in to cancelling the superseded one,
|
||||
# but ONLY for pull_request events. `deploy-test`/`deploy-production` never run on a pull_request
|
||||
# but ONLY for pull_request events. `deploy-sls-test`/`deploy-sls-production` never run on a pull_request
|
||||
# (they require a push to master or a workflow_dispatch, see those jobs' `if:` conditions), so
|
||||
# scoping cancel-in-progress to pull_request here can never abort a live deploy mid-flight.
|
||||
concurrency:
|
||||
@@ -31,8 +31,8 @@ concurrency:
|
||||
|
||||
# Reusable settings for this workflow. Change these in one place if the .NET/Node/pnpm version,
|
||||
# artifact names, or deploy destinations change. The env context is NOT available inside a called
|
||||
# reusable workflow's `with:` inputs (see the `config` job below, which works around this by passing
|
||||
# these values through as job outputs to the `deploy-test` / `deploy-production` jobs).
|
||||
# reusable workflow's `with:` inputs (see the `config-sls` job below, which works around this by passing
|
||||
# these values through as job outputs to the `deploy-sls-test` / `deploy-sls-production` jobs).
|
||||
env:
|
||||
DOTNET_VERSION: '10.0.x'
|
||||
NODE_VERSION: '20'
|
||||
@@ -51,8 +51,8 @@ env:
|
||||
|
||||
jobs:
|
||||
# Passes the env: values above through as job outputs, since the env context is unavailable in
|
||||
# the `with:` block of a job that calls a reusable workflow (see deploy-test / deploy-production).
|
||||
config:
|
||||
# the `with:` block of a job that calls a reusable workflow (see deploy-sls-test / deploy-sls-production).
|
||||
config-sls:
|
||||
runs-on: linux
|
||||
outputs:
|
||||
artifact_name_test: ${{ steps.set.outputs.artifact_name_test }}
|
||||
@@ -258,7 +258,7 @@ jobs:
|
||||
# --- Gate 4: frontend build ---
|
||||
# Validates the frontend compiles on its own, independent of any environment. The actual
|
||||
# per-environment deployable artifact is produced later by each publish job's own "Build admin
|
||||
# frontend" step (publish-test / publish-production, below), which builds frontend/ again with
|
||||
# frontend" step (publish-sls-test / publish-sls-production, below), which builds frontend/ again with
|
||||
# that environment's Vite variables set and copies the result into wwwroot/admin before
|
||||
# `dotnet publish` runs — see that step's comment for why this isn't an MSBuild target instead.
|
||||
frontend-build:
|
||||
@@ -356,7 +356,7 @@ jobs:
|
||||
# kept in sync with the host's real SecurityHeaders__AllowedScriptOrigins__0 env var (D-16). This
|
||||
# gate cannot see the actual runtime CSP configuration; it only catches drift between the frontend
|
||||
# build and what this variable claims the CSP allows.
|
||||
publish-test:
|
||||
publish-sls-test:
|
||||
needs: [changes, backend-build, backend-test, vulnerability-scan, frontend-build, frontend-test, frontend-lint]
|
||||
# always() bypasses the automatic skip-cascade from a gate job that was itself skipped (because
|
||||
# its side of the repo didn't change). Gitea Actions only implements always() from the GitHub
|
||||
@@ -437,12 +437,12 @@ jobs:
|
||||
path: ${{ env.ARTIFACT_NAME_TEST }}
|
||||
retention-days: 1
|
||||
|
||||
# Same as publish-test, but only for a manual workflow_dispatch run with deploy_production set —
|
||||
# a distinct job rather than a parameterized reuse of publish-test, because VITE_APP_ENV is a
|
||||
# Same as publish-sls-test, but only for a manual workflow_dispatch run with deploy_production set —
|
||||
# a distinct job rather than a parameterized reuse of publish-sls-test, because VITE_APP_ENV is a
|
||||
# Vite build-time value: one dist/ bundle cannot be tagged as both 'test' and 'production' (FR-05).
|
||||
publish-production:
|
||||
publish-sls-production:
|
||||
needs: [changes, backend-build, backend-test, vulnerability-scan, frontend-build, frontend-test, frontend-lint]
|
||||
# See publish-test's comment above on why this checks needs.<job>.result explicitly instead of
|
||||
# See publish-sls-test's comment above on why this checks needs.<job>.result explicitly instead of
|
||||
# failure()/cancelled(), which Gitea Actions doesn't support.
|
||||
if: |
|
||||
always() &&
|
||||
@@ -478,7 +478,7 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# See publish-test's "Build admin frontend" step for why this runs as its own step ahead of
|
||||
# See publish-sls-test's "Build admin frontend" step for why this runs as its own step ahead of
|
||||
# dotnet publish rather than an MSBuild target.
|
||||
- name: Build admin frontend
|
||||
working-directory: frontend
|
||||
@@ -512,18 +512,18 @@ jobs:
|
||||
# extra steps). A manual workflow_dispatch run only deploys to test when deploy_test is checked,
|
||||
# since a dispatch run is often just re-running CI/production, not a new test build (FR-03, D-01,
|
||||
# D-09).
|
||||
# deploy_path / service_name / health_check_url come straight from the Gitea variables, NOT from the `config` job
|
||||
# deploy_path / service_name / health_check_url come straight from the Gitea variables, NOT from the `config-sls` job
|
||||
# outputs: a job output whose value contains a secret value (here most likely the deploy account name inside the
|
||||
# path) is dropped by the runner, so the reusable workflow received an empty deploy_path ("/releases"). The
|
||||
# `config` outputs are still used for the artifact and environment names.
|
||||
deploy-test:
|
||||
needs: [publish-test, config]
|
||||
# `config-sls` outputs are still used for the artifact and environment names.
|
||||
deploy-sls-test:
|
||||
needs: [publish-sls-test, config-sls]
|
||||
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_test == 'true') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
||||
uses: ./.gitea/workflows/deploy-scp.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
artifact_name: ${{ needs.config.outputs.artifact_name_test }}
|
||||
environment: ${{ needs.config.outputs.deploy_environment_test }}
|
||||
artifact_name: ${{ needs.config-sls.outputs.artifact_name_test }}
|
||||
environment: ${{ needs.config-sls.outputs.deploy_environment_test }}
|
||||
deploy_path: ${{ vars.DEPLOY_PATH_TEST }}
|
||||
service_name: ${{ vars.SERVICE_NAME_TEST }}
|
||||
health_check_url: ${{ vars.HEALTH_CHECK_URL_TEST }}
|
||||
@@ -532,14 +532,14 @@ jobs:
|
||||
# Production deploy ONLY on an explicit workflow_dispatch run with deploy_production checked
|
||||
# (FR-04, D-09) — never reachable from a plain push to master, so pushing cannot deploy production
|
||||
# under any circumstance.
|
||||
deploy-production:
|
||||
needs: [publish-production, config]
|
||||
deploy-sls-production:
|
||||
needs: [publish-sls-production, config-sls]
|
||||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_production == 'true'
|
||||
uses: ./.gitea/workflows/deploy-scp.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
artifact_name: ${{ needs.config.outputs.artifact_name_production }}
|
||||
environment: ${{ needs.config.outputs.deploy_environment_production }}
|
||||
artifact_name: ${{ needs.config-sls.outputs.artifact_name_production }}
|
||||
environment: ${{ needs.config-sls.outputs.deploy_environment_production }}
|
||||
deploy_path: ${{ vars.DEPLOY_PATH_PRODUCTION }}
|
||||
service_name: ${{ vars.SERVICE_NAME_PRODUCTION }}
|
||||
health_check_url: ${{ vars.HEALTH_CHECK_URL_PRODUCTION }}
|
||||
@@ -583,7 +583,7 @@ jobs:
|
||||
|
||||
publish-asf-test:
|
||||
needs: [changes, backend-build, backend-test, vulnerability-scan, frontend-build, frontend-test, frontend-lint]
|
||||
# Same gate handling as publish-test (see there for why always() and explicit results), plus the
|
||||
# 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.
|
||||
if: |
|
||||
always() &&
|
||||
@@ -612,7 +612,7 @@ jobs:
|
||||
version: ${{ env.PNPM_VERSION }}
|
||||
|
||||
# Admin SPA with the ASF theme and Dutch as the default language. Lands in wwwroot/admin
|
||||
# BEFORE dotnet publish, for the same reason as in publish-test. No Umami for the admin.
|
||||
# BEFORE dotnet publish, for the same reason as in publish-sls-test. No Umami for the admin.
|
||||
- name: Build admin frontend (ASF theme)
|
||||
working-directory: frontend
|
||||
env:
|
||||
@@ -640,7 +640,7 @@ jobs:
|
||||
path: app-asf-test
|
||||
retention-days: 1
|
||||
|
||||
# Path/service/health straight from the Gitea variables, like deploy-test (a job output containing a secret value,
|
||||
# Path/service/health straight from the Gitea variables, like deploy-sls-test (a job output containing a secret value,
|
||||
# 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]
|
||||
|
||||
Reference in New Issue
Block a user