Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI and deploy

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
Expand Down Expand Up @@ -30,7 +31,7 @@ jobs:

deploy-frontend:
name: Frontend → Cloudflare Pages
if: github.event_name == 'push'
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: validate
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -62,7 +63,7 @@ jobs:

deploy-backend:
name: Backend → EC2
if: github.event_name == 'push'
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: validate
runs-on: ubuntu-latest
permissions:
Expand Down
31 changes: 22 additions & 9 deletions infra/aws/README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# TigerMap production infrastructure

TigerMap uses Cloudflare Pages for the web app and one EC2 instance for the
TigerMap uses Cloudflare Pages for the web app and the shared TigerApps-Combined EC2 host for the
Fastify API and its local SQLite data.

## AWS resources

- API instance: `i-0e1651e5f2954427d` (`tigermap-api`)
- API Elastic IP: `3.91.107.148`
- API security group: `sg-052b6b922dce1a08e` (`tigermap-api-sg`)
- Instance role/profile: `TigerMapInstanceRole`
- API instance: `i-0b2bfc5624ab3f9bf` (`TigerApps-Combined`)
- API Elastic IP: `3.91.107.148` (preserved, mapped to secondary private IP `172.31.39.135`)
- API security group: `sg-0e59d8cec0a11e75b` (`TigerApps-Combined`)
- Instance profile: `HarnessEc2SsmProfile`
- GitHub OIDC deploy role: `TigerMapGitHubDeployRole`
- Encrypted runtime parameters: `/tigermap/production/*`

The GitHub role is scoped to the `main` branch of the exact TigerAppsOrg
repository ID. It can only send an SSM command to the TigerMap instance and
repository ID. It can only send an SSM command to the Combined instance and
read that command's result. No long-lived AWS key is stored in GitHub.

The EC2 environment file remains the runtime source for the current service.
Its values are also backed up as encrypted SSM parameters for recovery. Never
commit decrypted parameter values.

The API security group exposes HTTP on port 80 for the Pages Function proxy.
Administrative access uses SSM, so the instance has no public SSH ingress.
The shared host exposes HTTP/HTTPS through nginx. The TigerMap virtual host
proxies to port 3001. Deployment uses SSM; the shared host also supports SSH.

## GitHub configuration

Repository variables:

- `AWS_REGION=us-east-1`
- `AWS_DEPLOY_ROLE_ARN=arn:aws:iam::104733724423:role/TigerMapGitHubDeployRole`
- `EC2_INSTANCE_ID=i-0e1651e5f2954427d`
- `EC2_INSTANCE_ID=i-0b2bfc5624ab3f9bf`
- `CLOUDFLARE_ACCOUNT_ID=e2744783298a24185adfbc07174ba2ae`
- `VITE_CAMPUS_MAP_TOKEN` (public token embedded in the web bundle)
- `VITE_CAMPUS_MAP_STYLE`
Expand All @@ -42,3 +42,16 @@ Repository secrets:
Backend deployment uses SSM. The production checkout is updated with a
fast-forward-only merge, dependencies are installed from the lockfile, and
the API is restarted only after those steps succeed.

## Consolidation — 2026-11-20

The original API instance was migrated to Combined. `/home/ubuntu/TigerMap`,
its SQLite databases and images, runtime environment, Bun binary, and the
`tigermap-api` systemd service retain their existing paths. The public API IP
and Cloudflare Pages API_HOST continue to work unchanged. Secondary addresses
are persisted in `/etc/netplan/60-consolidated-apps.yaml`.

The GitHub repository variable and `DeployTigerMapOnly` IAM policy must both
target Combined. The workflow supports manual deployment as well as main pushes.
Because this is a shared host, avoid host-wide restarts or cleanup in deployment
commands; restart only `tigermap-api`.
2 changes: 1 addition & 1 deletion infra/aws/github-deploy-policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"Effect": "Allow",
"Action": "ssm:SendCommand",
"Resource": [
"arn:aws:ec2:us-east-1:104733724423:instance/i-0e1651e5f2954427d",
"arn:aws:ec2:us-east-1:104733724423:instance/i-0b2bfc5624ab3f9bf",
"arn:aws:ssm:us-east-1::document/AWS-RunShellScript"
]
},
Expand Down
Loading