|
|
|
@@ -11,10 +11,10 @@ Sinds deze stap wordt er automatisch gedeployed naar een **testomgeving**: een R
|
|
|
|
|
- `continuous_integration.yaml` — getriggerd door `pull_request` (build/test/lint-gate, ongeacht branch), `push` naar `master` (build/test/lint-gate + `deploy-test`), en handmatig via `workflow_dispatch` (met een optioneel `deploy_production`-vinkje).
|
|
|
|
|
- Heeft bovenaan een `env:`-blok met alle aanpasbare waarden op één plek: `NODE_VERSION`, `PNPM_VERSION`, `ARTIFACT_NAME` (`dist`), `ARTIFACT_NAME_PRODUCTION` (`dist-production`), `ARTIFACT_PATH` (`dist/`), `DEPLOY_ENVIRONMENT` (`test`), `DEPLOY_PATH` (gelezen uit de Gitea repository variable `DEPLOY_PATH_TEST`, zie hieronder — bewust geen hardcoded pad), `DEPLOY_ENVIRONMENT_PRODUCTION` (`production`) en `DEPLOY_PATH_PRODUCTION` (gelezen uit de variable `DEPLOY_PATH_PRODUCTION`).
|
|
|
|
|
- `prepare` → `build` (test-bundel, `VITE_APP_ENV=test`) → `test` (lint + unit tests)
|
|
|
|
|
- `build-production` draait ernaast, alléén als `deploy_production` is aangevinkt bij een handmatige `workflow_dispatch`-run. Dit is een aparte build (niet hetzelfde artifact als `build`) omdat `VITE_APP_ENV` een build-time Vite-variabele is: één bundel kan niet tegelijk als `test` én `production` getagd zijn in Sentry/analytics.
|
|
|
|
|
- `build-production` draait ernaast, alléén als `deploy_production` is aangevinkt bij een handmatige `workflow_dispatch`-run **op een `release/*`-branch**. Dit is een aparte build (niet hetzelfde artifact als `build`) omdat `VITE_APP_ENV` een build-time Vite-variabele is: één bundel kan niet tegelijk als `test` én `production` getagd zijn in Sentry/analytics.
|
|
|
|
|
- Een losse `config`-job zet alle `env`-waarden (test én productie) om in job-outputs (zie hieronder waarom dat nodig is).
|
|
|
|
|
- `deploy-test` (bij `workflow_dispatch` of een push naar `master`) roept `deploy.yaml` aan met `artifact_name`/`environment`/`deploy_path` afkomstig van `needs.config.outputs.*` (dus indirect uit het `env:`-blok).
|
|
|
|
|
- `deploy-production` (alléén bij `workflow_dispatch` mét `deploy_production: true`) roept `deploy.yaml` op dezelfde manier aan, maar met de productie-artifact/omgeving/pad. Draait **nooit** automatisch bij een push naar `master`.
|
|
|
|
|
- `deploy-production` (alléén bij `workflow_dispatch` mét `deploy_production: true` **én een ref die met `refs/heads/release/` begint**, zoals de ASF-site; een dispatch vanaf `master` of een feature-branch doet voor productie niets) roept `deploy.yaml` op dezelfde manier aan, maar met de productie-artifact/omgeving/pad. Draait **nooit** automatisch bij een push naar `master`.
|
|
|
|
|
- `deploy.yaml` — download de artifact (naam/lokaal pad = `inputs.artifact_name`) en upload de inhoud via een `scp`-commando (met `sshpass` voor het wachtwoord) in een gewone shell-stap naar de opgegeven `deploy_path` op de host uit de meegegeven secrets. Deze workflow is omgeving-agnostisch (test/productie) en hoefde niet gewijzigd te worden.
|
|
|
|
|
|
|
|
|
|
### Waarom `sshpass`/`scp` in een shell-stap in plaats van de `appleboy/scp-action` Docker-action?
|
|
|
|
@@ -77,7 +77,7 @@ Merge een pull request naar `master` — de `deploy-test` job draait dan automat
|
|
|
|
|
Productie deployt **nooit** automatisch bij een push naar `master` — alleen via een expliciete, handmatige actie:
|
|
|
|
|
1. In Gitea, open de repository's **Actions** tab.
|
|
|
|
|
2. Selecteer de **Continuous Integration** workflow.
|
|
|
|
|
3. Klik **Run workflow**, kies de gewenste branch/ref (meestal `master`).
|
|
|
|
|
3. Klik **Run workflow**, kies een branch `release/<naam>` (bijv. `release/2026-11-20`, gemaakt vanaf `master`). Vanaf een andere branch (ook `master`) gebeurt er voor productie niets, ook niet met het vinkje.
|
|
|
|
|
4. Vink **`deploy_production`** aan voordat je de run start.
|
|
|
|
|
5. Dit triggert naast de gebruikelijke `build`/`test`/`deploy-test` ook `build-production` en `deploy-production`.
|
|
|
|
|
|
|
|
|
|