50 lines
2.0 KiB
YAML
50 lines
2.0 KiB
YAML
name: Deploy Staging
|
|
|
|
# Continuous deployment to the LOCAL staging stack. Fires when develop advances
|
|
# (i.e. after a PR is merged into develop), rebuilding and restarting the isolated
|
|
# staging stack on this machine.
|
|
#
|
|
# Runs on the self-hosted host-mode runner (labels: self-hosted, windows) so it can
|
|
# reach the host's Docker and publish to localhost:18081. Because the runner does a
|
|
# fresh checkout that (correctly) does NOT contain the git-ignored deploy/.env.staging,
|
|
# the staging secrets are supplied as Gitea Actions secrets and the env file is
|
|
# regenerated here at deploy time.
|
|
on:
|
|
push:
|
|
branches: [develop]
|
|
workflow_dispatch: {} # also allow a manual "Run workflow" from the Gitea UI
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: [self-hosted, windows]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Write staging env from secrets
|
|
shell: powershell
|
|
# Single-quoted here-string: Gitea substitutes the ${{ secrets.* }} tokens
|
|
# before the shell runs, and PowerShell then treats the values literally
|
|
# (no $ interpolation). ascii = no BOM, which docker compose's env parser needs.
|
|
run: |
|
|
@'
|
|
POSTGRES_PASSWORD=${{ secrets.STAGING_POSTGRES_PASSWORD }}
|
|
GOOGLE_CLIENT_ID=${{ secrets.STAGING_GOOGLE_CLIENT_ID }}
|
|
GOOGLE_CLIENT_SECRET=${{ secrets.STAGING_GOOGLE_CLIENT_SECRET }}
|
|
AI_MODE=Disabled
|
|
FRONTEND_ORIGIN=http://localhost:18081
|
|
MAX_MESSAGES=2000
|
|
'@ | Out-File -FilePath deploy/.env.staging -Encoding ascii
|
|
|
|
- name: Redeploy staging stack
|
|
shell: powershell
|
|
run: |
|
|
docker compose -p inboxintel-staging `
|
|
--env-file deploy/.env.staging `
|
|
-f docker-compose.yml -f docker-compose.staging.yml `
|
|
up -d --build
|
|
docker compose -p inboxintel-staging ps
|
|
|
|
- name: Staging endpoints
|
|
shell: powershell
|
|
run: Write-Host "Staging up — Frontend http://localhost:18081 API http://localhost:18080/swagger"
|