diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 024fdc7..55b88a4 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -202,6 +202,25 @@ In GitHub: - `development` - `production` +### Exact GitHub UI path +1. Open the private repository: + - `https://github.com/Bostame/workdock-platform` +2. Click: + - `Settings` +3. In the left sidebar, open: + - `Environments` +4. Click: + - `New environment` +5. Create: + - `development` +6. Repeat and create: + - `production` +7. Open the `development` environment +8. Under `Environment secrets`, click: + - `Add environment secret` +9. Add each required secret one by one +10. Repeat the same pattern later for `production` + ### Development environment secrets Add: - `TEST_DEPLOY_HOST` @@ -217,6 +236,49 @@ Current test values: - `TEST_DEPLOY_PATH=/opt/workdock` - `TEST_DEPLOY_SSH_KEY=` +### Development secret entry example +Use these exact values in the `development` environment: + +`TEST_DEPLOY_HOST` +```text +192.168.2.55 +``` + +`TEST_DEPLOY_USER` +```text +root +``` + +`TEST_DEPLOY_PORT` +```text +22 +``` + +`TEST_DEPLOY_PATH` +```text +/opt/workdock +``` + +`TEST_DEPLOY_SSH_KEY` +```text + +``` + +The SSH key must include the full multi-line content, for example: +```text +-----BEGIN OPENSSH PRIVATE KEY----- +... +-----END OPENSSH PRIVATE KEY----- +``` + +### How to verify the SSH key before adding it +From your local machine: +```bash +ssh -4 root@192.168.2.55 +``` + +If that works without asking for a password, the matching private key is the correct one to store in `TEST_DEPLOY_SSH_KEY`. + ### Production environment secrets Add: - `PROD_DEPLOY_HOST` @@ -239,6 +301,38 @@ From GitHub Actions: 1. open `Deploy Test` 2. click `Run workflow` +### First GitHub Actions validation +After you add the `development` environment secrets: +1. Open: + - `https://github.com/Bostame/workdock-platform/actions` +2. Open workflow: + - `Deploy Test` +3. Click: + - `Run workflow` +4. Select branch: + - `develop` +5. Run it +6. Wait until both steps complete: + - upload bundle + - deploy over SSH +7. Verify: + - `http://192.168.2.55:8088/healthz/` +8. Then open the app home page in the browser + +### What success looks like +- workflow status is green in GitHub Actions +- `Deploy Test` job finishes without SSH or health-check errors +- `/healthz/` returns `200 OK` +- the containers on the test server remain up + +### If the workflow fails +Check in this order: +1. wrong or incomplete `TEST_DEPLOY_SSH_KEY` +2. wrong `TEST_DEPLOY_USER` +3. wrong `TEST_DEPLOY_PATH` +4. changed server host key +5. server disk-space or Docker runtime issue + ## How to validate a deployment ### From your machine ```bash diff --git a/backend/workflows/templates/workflows/developer_handbook.html b/backend/workflows/templates/workflows/developer_handbook.html index d991796..c0b0a39 100644 --- a/backend/workflows/templates/workflows/developer_handbook.html +++ b/backend/workflows/templates/workflows/developer_handbook.html @@ -298,6 +298,17 @@ make backup-verify BACKUP_DIR=backups/backup_YYYYmmdd_HHMMSS +

Exact GitHub UI steps

+
    +
  1. Open the private repository on GitHub.
  2. +
  3. Open Settings.
  4. +
  5. Open Environments in the left sidebar.
  6. +
  7. Create the environment development.
  8. +
  9. Create the environment production.
  10. +
  11. Open development.
  12. +
  13. Under Environment secrets, add the deployment secrets one by one.
  14. +
  15. Repeat later for production.
  16. +

Current test deployment values

+

Current development secrets

+ +

First GitHub Actions test

+
    +
  1. Open GitHub Actions.
  2. +
  3. Run the workflow Deploy Test on branch develop.
  4. +
  5. Wait for the SSH upload and deploy steps to finish successfully.
  6. +
  7. Verify http://192.168.2.55:8088/healthz/ returns HTTP 200.
  8. +
  9. Then verify the app UI in the browser.
  10. +
The current LAN test deployment intentionally uses DJANGO_DEBUG=1 in .env.test because the security checks correctly reject insecure cookie settings when DEBUG=0 and the deployment is still plain HTTP. This is acceptable for the internal test box only. Production must run with HTTPS and DEBUG=0.