Skip to content

Commit 92fc275

Browse files
committed
ci: add deploy workflow
1 parent cc8ded8 commit 92fc275

4 files changed

Lines changed: 64 additions & 2 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy production
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Release tag being deployed, such as v1.2.3'
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
deploy:
16+
name: Deploy to production
17+
uses: ./.github/workflows/_deploy-environment.yml
18+
with:
19+
tag: ${{ inputs.tag }}
20+
environment: production
21+
secrets: inherit
22+
23+
health-check:
24+
name: Health check production
25+
needs: deploy
26+
uses: ./.github/workflows/deploy-health-check.yml
27+
with:
28+
tag: ${{ inputs.tag }}
29+
environment: production
30+
profile: cloud
31+
secrets: inherit

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
**A daily planner for minimalists. Organize your day and lock-in.**
44

55
<img width="1512" height="860" alt="week-view-2026-06" src="https://github.com/user-attachments/assets/6dcfd741-883d-401c-b8e2-97300b1dd925" />
6-
<img width="1508" height="835" alt="day-view-2026-06" src="https://github.com/user-attachments/assets/adce91f8-40b1-4990-afa1-859ab61a7dab" />
7-
86

97
## Why Try Compass?
108

docs/CI-CD/workflows.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Compass uses GitHub Actions for continuous integration, Docker Hub for image dis
99
| Release on main | Push to `main` | Auto-increments patch version, publishes Docker images, then deploys staging |
1010
| Publish Docker images | Reusable workflow / manual dispatch / manual `v*.*.*` tag push | Builds and pushes Docker images only |
1111
| Deploy staging | Reusable workflow / manual dispatch | Pulls published images on staging, restarts the stack, then runs deploy health checks |
12+
| Deploy production | Manual dispatch | Deploys a release tag to production, then runs cloud deploy health checks |
1213
| Deploy health check | Reusable workflow | Validates the deployed staging stack and alerts Discord on failure |
1314
| Sync docs to compass-docs | Push to `main` touching `docs/**` | Mirrors this `docs/` directory to docs.compasscalendar.com |
1415

@@ -127,3 +128,19 @@ Secrets and variables are split between repository level (shared across workflow
127128
| `BACKEND_API_URL` | Staging backend API URL |
128129
| `FRONTEND_URL` | Staging frontend URL |
129130
| `GOOGLE_CLIENT_ID` | OAuth client ID |
131+
132+
---
133+
134+
## Production Deploy
135+
136+
Source: [`.github/workflows/deploy-production.yml`](../../.github/workflows/deploy-production.yml)
137+
138+
Production deploys are manual-only. Run `Deploy production` from GitHub Actions
139+
with an existing release tag, such as `v1.2.3`; it is not called by
140+
`release-on-main.yml` and does not run automatically after PR merges.
141+
142+
The workflow deploys to the GitHub `production` environment through
143+
`_deploy-environment.yml`, builds an environment-specific web image tagged
144+
`switchbacktech/compass-web:production-<version>`, then runs
145+
`deploy-health-check.yml` with the `cloud` profile. Production is expected to use
146+
external MongoDB and SuperTokens Cloud rather than self-hosted data services.

self-host/docker-compose.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,22 @@ describe("staging deploy workflow", () => {
182182
expect(workflow).toContain("profile: selfhosted");
183183
});
184184

185+
it("provides a manual production deploy workflow with cloud health checks", () => {
186+
const workflow = readRepoFile(".github/workflows/deploy-production.yml");
187+
188+
expect(workflow).toContain("workflow_dispatch:");
189+
expect(workflow).not.toContain("workflow_call:");
190+
expect(workflow).toContain(
191+
"uses: ./.github/workflows/_deploy-environment.yml",
192+
);
193+
expect(workflow).toContain("environment: production");
194+
expect(workflow).toContain(
195+
"uses: ./.github/workflows/deploy-health-check.yml",
196+
);
197+
expect(workflow).toContain("needs: deploy");
198+
expect(workflow).toContain("profile: cloud");
199+
});
200+
185201
it("provides a reusable deploy health check workflow with Discord failure alerts", () => {
186202
const workflow = readRepoFile(".github/workflows/deploy-health-check.yml");
187203

0 commit comments

Comments
 (0)