diff --git a/backend/workflows/templates/workflows/developer_handbook.html b/backend/workflows/templates/workflows/developer_handbook.html index d72a959..04d5474 100644 --- a/backend/workflows/templates/workflows/developer_handbook.html +++ b/backend/workflows/templates/workflows/developer_handbook.html @@ -287,73 +287,98 @@ make backup-verify BACKUP_DIR=backups/backup_YYYYmmdd_HHMMSS

14) CI/CD

- -

GitHub Environments

- -

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. -
+
+

Current operating model

+ +
+ +
+

Why deploy is manual right now

+

The test server is inside the local network and uses a private IP address 192.168.2.55. GitHub-hosted runners on the public internet cannot reliably reach that target. Because of that, the correct deployment path today is:

+
    +
  1. push code to GitHub
  2. +
  3. let GitHub run CI
  4. +
  5. deploy from the Mac on the same LAN
  6. +
+

Automatic CD from GitHub becomes appropriate only after moving to a public server or using a self-hosted runner inside the LAN.

+
+ +
+

What to do for normal work

+
    +
  1. Start from develop.
  2. +
  3. Do the implementation work.
  4. +
  5. Push to GitHub.
  6. +
  7. Let CI finish.
  8. +
  9. Run the local test deployment helper from the Mac.
  10. +
  11. Verify the updated version in the browser.
  12. +
  13. When the integration line is stable, merge develop into main.
  14. +
+
+ +
+

One-command test deployment

+

From the Mac on the same network:

+
git checkout develop
+./scripts/deploy_test_from_mac.sh
+

This helper script does all of the following:

+
    +
  1. checks that the current branch is develop
  2. +
  3. fast-forwards from origin/develop
  4. +
  5. checks that the server env file exists
  6. +
  7. syncs the repository to /opt/workdock with rsync
  8. +
  9. preserves server-local env files like .env.test and .env.prod
  10. +
  11. runs the remote deployment script
  12. +
  13. waits for the health endpoint
  14. +
  15. prints the deployed commit and branch
  16. +
+
+ +
+

Current test server values

+ +
+ +
+

GitHub Actions status

+ +
+ +
+

If the local deploy helper fails

+
    +
  1. Check whether /opt/workdock/.env.test still exists on the server.
  2. +
  3. Check SSH access from the Mac: +
    ssh -4 root@192.168.2.55
    +
  4. +
  5. Check server health directly: +
    curl -I http://192.168.2.55:8088/healthz/
    +
  6. +
  7. Check container status: +
    ssh root@192.168.2.55 "cd /opt/workdock && docker compose --env-file .env.test -f docker-compose.prod.yml ps"
    +
  8. +
+
+
- 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. + 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 behind a local test topology. This is acceptable for the test box only. Production must run with HTTPS and DEBUG=0.

15) Deployment