File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,15 +176,16 @@ jobs:
176176 run : npm run test:e2e:run
177177 env :
178178 CI : true
179- SESSION_SECRET : ${{ secrets.SESSION_SECRET }}
180- MAGIC_LINK_SECRET : ${{ secrets.MAGIC_LINK_SECRET }}
179+ SESSION_SECRET : test-session-secret
180+ MAGIC_LINK_SECRET : test-magic-link-secret
181181 MAILGUN_SENDING_KEY : nothing
182182 MAILGUN_DOMAIN : nothing
183183
184184 deploy :
185185 name : Deploy to production
186186 runs-on : ubuntu-latest
187187 needs : [lint, type-check, unit-test, e2e-test]
188+ environment : production
188189 # Only run on push to main (not on PRs)
189190 if : github.event_name == 'push' || github.event_name == 'workflow_dispatch'
190191
Original file line number Diff line number Diff line change @@ -22,18 +22,29 @@ Deployment is automated via GitHub Actions:
2222
2323## Required GitHub Secrets
2424
25- Configure these secrets in your repository settings
26- (` Settings > Secrets and variables > Actions ` ):
25+ Configure secrets in ` Settings > Secrets and variables > Actions ` .
26+
27+ ### Repository Secrets (shared across environments)
2728
2829| Secret | Description |
2930| ------------------------- | -------------------------------------------------------- |
3031| ` SSH_PRIVATE_KEY ` | SSH private key for accessing the VPS |
3132| ` KAMAL_REGISTRY_PASSWORD ` | GitHub Personal Access Token with ` write:packages ` scope |
32- | ` SESSION_SECRET ` | Session encryption secret |
33- | ` MAGIC_LINK_SECRET ` | Magic link email authentication secret |
3433| ` MAILGUN_SENDING_KEY ` | Mailgun API key for sending emails |
3534| ` MAILGUN_DOMAIN ` | Mailgun domain (e.g., ` mg.rumahberbagi.com ` ) |
3635
36+ ### Environment Secrets (per environment)
37+
38+ Create two environments: ` production ` and ` staging ` in
39+ ` Settings > Environments ` . Add these secrets to each:
40+
41+ | Secret | Description |
42+ | ------------------- | -------------------------------------- |
43+ | ` SESSION_SECRET ` | Session encryption secret |
44+ | ` MAGIC_LINK_SECRET ` | Magic link email authentication secret |
45+
46+ ** Note:** Use different values for each environment to isolate auth tokens.
47+
3748### SSH Key Setup
3849
39501 . Generate an SSH key pair (if not already done):
You can’t perform that action at this time.
0 commit comments