Fix staging auto-deploy: env write + port isolation (#3)
This commit was merged in pull request #3.
This commit is contained in:
@@ -22,18 +22,17 @@ jobs:
|
|||||||
|
|
||||||
- name: Write staging env from secrets
|
- name: Write staging env from secrets
|
||||||
shell: powershell
|
shell: powershell
|
||||||
# Single-quoted here-string: Gitea substitutes the ${{ secrets.* }} tokens
|
# Per-line writes (not a here-string) so the step can't be broken by how the
|
||||||
# before the shell runs, and PowerShell then treats the values literally
|
# runner indents/wraps the script. Gitea substitutes ${{ secrets.* }} first;
|
||||||
# (no $ interpolation). ascii = no BOM, which docker compose's env parser needs.
|
# ascii = no BOM, which docker compose's env parser needs.
|
||||||
run: |
|
run: |
|
||||||
@'
|
Set-Content deploy/.env.staging "POSTGRES_PASSWORD=${{ secrets.STAGING_POSTGRES_PASSWORD }}" -Encoding ascii
|
||||||
POSTGRES_PASSWORD=${{ secrets.STAGING_POSTGRES_PASSWORD }}
|
Add-Content deploy/.env.staging "GOOGLE_CLIENT_ID=${{ secrets.STAGING_GOOGLE_CLIENT_ID }}" -Encoding ascii
|
||||||
GOOGLE_CLIENT_ID=${{ secrets.STAGING_GOOGLE_CLIENT_ID }}
|
Add-Content deploy/.env.staging "GOOGLE_CLIENT_SECRET=${{ secrets.STAGING_GOOGLE_CLIENT_SECRET }}" -Encoding ascii
|
||||||
GOOGLE_CLIENT_SECRET=${{ secrets.STAGING_GOOGLE_CLIENT_SECRET }}
|
Add-Content deploy/.env.staging "AI_MODE=Disabled" -Encoding ascii
|
||||||
AI_MODE=Disabled
|
Add-Content deploy/.env.staging "FRONTEND_ORIGIN=http://localhost:18081" -Encoding ascii
|
||||||
FRONTEND_ORIGIN=http://localhost:18081
|
Add-Content deploy/.env.staging "MAX_MESSAGES=2000" -Encoding ascii
|
||||||
MAX_MESSAGES=2000
|
Write-Host "wrote $((Get-Content deploy/.env.staging).Count) env lines"
|
||||||
'@ | Out-File -FilePath deploy/.env.staging -Encoding ascii
|
|
||||||
|
|
||||||
- name: Redeploy staging stack
|
- name: Redeploy staging stack
|
||||||
shell: powershell
|
shell: powershell
|
||||||
|
|||||||
@@ -21,7 +21,9 @@
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
ports:
|
# !override replaces the base port list instead of merging with it, so staging
|
||||||
|
# binds ONLY its shifted 18xxx/15432 ports and never squats on prod's 8080/8081.
|
||||||
|
ports: !override
|
||||||
- "127.0.0.1:15432:5432"
|
- "127.0.0.1:15432:5432"
|
||||||
|
|
||||||
api:
|
api:
|
||||||
@@ -32,13 +34,13 @@ services:
|
|||||||
App__DevMode: "true"
|
App__DevMode: "true"
|
||||||
GmailSync__MaxMessages: ${MAX_MESSAGES:-2000}
|
GmailSync__MaxMessages: ${MAX_MESSAGES:-2000}
|
||||||
Cors__Origins__0: ${FRONTEND_ORIGIN:-http://localhost:18081}
|
Cors__Origins__0: ${FRONTEND_ORIGIN:-http://localhost:18081}
|
||||||
ports:
|
ports: !override
|
||||||
- "127.0.0.1:18080:8080"
|
- "127.0.0.1:18080:8080"
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
ports:
|
ports: !override
|
||||||
- "18081:80"
|
- "18081:80"
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
ports:
|
ports: !override
|
||||||
- "18000:80"
|
- "18000:80"
|
||||||
|
|||||||
Reference in New Issue
Block a user