Epic 0: Firebase auth, Cloud Run deploy, CI/CD automation

Draft
DO
1d ago
+0-0

Summary

  • Firebase Terraform module with Identity Platform config — automates Google Sign-In provider setup and authorized domains (localhost for dev). Apple Sign-In requires manual Apple Developer credentials.
  • Cloud Run Terraform module — service definition with scale-to-zero, IAM for public access, and ignore_changes on image so CI can deploy new revisions without Terraform drift.
  • deploy-api CI job — builds Docker image, pushes to Artifact Registry, deploys to Cloud Run via Workload Identity Federation (main branch only).
  • mobile-build CI job — generates .env from GitHub secrets, runs expo export --platform web, uploads build artifact.
  • bootstrap-secrets.sh — reads Terraform outputs and populates GitHub Actions secrets via gh secret set. Supports --dry-run and --env flags.

Two-phase Firebase setup

  1. First terraform apply: Creates Firebase project + Identity Platform. Firebase auto-creates an OAuth client for Google Sign-In.
  2. Retrieve the auto-created OAuth client ID from GCP Console → APIs & Services → Credentials.
  3. Second terraform apply with google_sign_in_client_id variable set to enable the Google provider.

Required GitHub Secrets (manual, not from Terraform)

SecretSource
GCP_PROJECT_IDYour GCP project ID
GCP_WORKLOAD_IDENTITY_PROVIDERWIF provider resource name
GCP_SERVICE_ACCOUNTCI/CD service account email

Test plan

  • terraform validate — all 3 modules pass (firebase, cloud-run, dev environment)
  • CI YAML — valid syntax
  • terraform plan against real GCP project
  • ./scripts/bootstrap-secrets.sh --dry-run after Terraform apply
  • CI deploy-api job runs on merge to main

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Mobile app build and export to web enabled via CI/CD pipeline.
    • Firebase authentication with Google Sign-In support now integrated.
    • Automated Cloud Run deployment for API on main branch pushes.
  • Documentation

    • Added infrastructure setup guide and GCP bootstrap runbook for developers.