Skip to content

feat(infra): GCP Cloud Run deployment setup#4

Open
jtomaszewski wants to merge 6 commits intodevelop-gcpfrom
jtomaszewski/gcp-cloud-run-deploy
Open

feat(infra): GCP Cloud Run deployment setup#4
jtomaszewski wants to merge 6 commits intodevelop-gcpfrom
jtomaszewski/gcp-cloud-run-deploy

Conversation

@jtomaszewski
Copy link
Copy Markdown

Summary

  • Add Terraform infrastructure (Cloud SQL, Artifact Registry, Secret Manager, OIDC) and Cloud Run service/migration modules
  • Add GitHub Actions workflows for dev deploy, PR preview environments, and cleanup
  • Add database clone/cleanup scripts for preview environment lifecycle

Test plan

  • Preview deploy triggered by this PR validates the full pipeline
  • Cloud Run service starts and passes health check
  • Database migration job completes successfully

🤖 Generated with Claude Code

jtomaszewski and others added 4 commits April 11, 2026 10:04
…ctions

Add complete infrastructure-as-code setup for deploying open-mercato to
GCP Cloud Run, enabling PR preview environments for CI validation without
running the app locally.

Terraform modules:
- bootstrap: GCS state bucket provisioning
- infrastructure: Cloud SQL Postgres 17, Artifact Registry, Secrets Manager,
  GitHub Actions OIDC workload identity
- mercato: Cloud Run v2 service + migration job (in-memory cache, local queue)

GitHub Actions workflows:
- deploy.yml: reusable build/migrate/deploy workflow
- deploy-dev.yml: auto-deploy on develop branch push
- deploy-preview.yml: ephemeral PR preview environments
- cleanup-previews.yml: weekly cleanup of stale previews

Application scripts for preview DB management:
- clone-database.ts: creates PR database from template
- cleanup-orphaned-databases.ts: drops databases for closed PRs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t-delete

- Switch startup/liveness probes from tcp_socket to http_get (Cloud Run v2 requirement)
- Use Google's placeholder image instead of non-existent registry image for initial deploy
- Fix GCS soft-delete retention from 365 days to 7 days (GCS max is 90 days)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Hardcode project ID, Cloud SQL instance, WIF provider, and service account
as defaults so workflows work without repo variables. All values can still
be overridden via GitHub repo variables (vars.*).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add github_extra_repos variable to allow additional GitHub repos to
authenticate via Workload Identity Federation. Needed for fsh fork deploys.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The db:clone and db:cleanup-orphaned scripts use tsx to run TypeScript.
Without it in production deps, Cloud Run migration jobs fail with exit 127.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Preview Environment

Service URL
App https://om-pr-4-2c3jgl64za-ew.a.run.app

Database: open_mercato_pr_4
Image Tag: pr-4-374562b6d00c6a2e574f17ebf2c3b3e79cce4088

jtomaszewski pushed a commit that referenced this pull request Apr 14, 2026
…arry-forward open-mercato#1485) (open-mercato#1488)

* fix: translations

* fix(i18n): sync missing translations + restore BC-critical exports (carry-forward open-mercato#1485)

Carry-forward of open-mercato#1485 (fork PR by @Sawarz) with the blocker findings
from code review applied so it can merge cleanly.

Applied fixes:
- Restored `export const emitCatalogEvent` in `packages/core/src/modules/catalog/events.ts`
  (removed in open-mercato#1485 — breaks BC surface #4 *Import paths: STABLE*).
- Restored `export const emitSalesEvent` in `packages/core/src/modules/sales/events.ts`
  (same reason).
- Restored `packages/core/src/modules/sales/lib/statusHistory.ts` with its
  `StatusChangeLogInput` type and `logStatusChange` helper (part of SPEC-006 / SPEC-059
  public surface).
- Added the two new `auth.acl.*` keys and fourteen new `workflows.checkoutDemo.*`
  keys to `pl.json`, `es.json`, and `de.json` so `i18n-check-sync` passes
  (this was the root cause of the `test` job failure on open-mercato#1485).
- Sorted the touched locale files alphabetically per the check's format rule.
- Kept the original author's AclEditor i18n hookups, workflows checkout-demo
  i18n hookups, and package.json `@types/*` devDeps move.

Credit: original translations + AclEditor wiring by @Sawarz in open-mercato#1485.

CI/verification:
- `yarn build:packages` — OK
- `yarn generate` — OK
- `yarn typecheck` — OK across all 18 packages
- `yarn test` — 2364/2364 pass
- `yarn tsx scripts/i18n-check-sync.ts` — clean

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Sawarz <sawarz22@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant