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
100 changes: 0 additions & 100 deletions .github/workflows/deploy-map.yml

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ defaults:

env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_PUBLIC_COVERAGE_API_URL: https://coverage-api.airframes.io
NEXT_PUBLIC_WS_URL: wss://coverage-api.airframes.io/ws
NEXT_PUBLIC_COVERAGE_API_URL: https://staging-coverage.airframes.io
NEXT_PUBLIC_WS_URL: wss://staging-coverage.airframes.io/ws
NEXT_PUBLIC_MAP_STYLE_URL: https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json

jobs:
Expand Down Expand Up @@ -75,8 +75,8 @@ jobs:
context: map
push: false
build-args: |
NEXT_PUBLIC_COVERAGE_API_URL=https://coverage-api.airframes.io
NEXT_PUBLIC_WS_URL=wss://coverage-api.airframes.io/ws
NEXT_PUBLIC_COVERAGE_API_URL=https://staging-coverage.airframes.io
NEXT_PUBLIC_WS_URL=wss://staging-coverage.airframes.io/ws
cache-from: type=gha,scope=map
cache-to: type=gha,scope=map,mode=max

Expand All @@ -102,7 +102,7 @@ jobs:
push: true
tags: ghcr.io/airframesio/coverage-map:latest
build-args: |
NEXT_PUBLIC_COVERAGE_API_URL=https://coverage-api.airframes.io
NEXT_PUBLIC_WS_URL=wss://coverage-api.airframes.io/ws
NEXT_PUBLIC_COVERAGE_API_URL=https://staging-coverage.airframes.io
NEXT_PUBLIC_WS_URL=wss://staging-coverage.airframes.io/ws
cache-from: type=gha,scope=map
cache-to: type=gha,scope=map,mode=max
43 changes: 24 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,30 @@ cd service && docker compose up

### Map on Cloudflare Pages

The map is fully client-rendered, so it ships to Cloudflare Pages as a static export:

```bash
cd map
npm run build:static # writes map/out
npx wrangler pages deploy out --project-name=airframes-coverage
```

`.github/workflows/deploy-map.yml` does this automatically: pushes to `main` publish production,
pull requests publish a preview. It needs two repository secrets:

| Secret | Description |
|--------|-------------|
| `CLOUDFLARE_API_TOKEN` | API token with **Account → Cloudflare Pages → Edit** |
| `CLOUDFLARE_ACCOUNT_ID` | Cloudflare account ID |

Optional repository variables: `CLOUDFLARE_PAGES_PROJECT` (default `airframes-coverage`),
`NEXT_PUBLIC_COVERAGE_API_URL`, `NEXT_PUBLIC_WS_URL`, `NEXT_PUBLIC_MAP_STYLE_URL`.
The workflow skips the deploy step (with a warning) until the secrets exist.
The map is fully client-rendered, so it ships to Cloudflare Pages as a static export. The Pages
project is connected to this repository through Cloudflare's Git integration (same as the globe),
so pushes to `main` publish production and pull requests get preview deployments. No GitHub
secrets or deploy workflow are involved.

Pages project build settings:

| Setting | Value |
|---------|-------|
| Root directory | `map` |
| Build command | `npm run build:static` |
| Build output directory | `out` |
| Environment variable `NODE_VERSION` | `24` |
| Environment variable `NEXT_PUBLIC_COVERAGE_API_URL` | `https://staging-coverage.airframes.io` |
| Environment variable `NEXT_PUBLIC_WS_URL` | `wss://staging-coverage.airframes.io/ws` |

The coverage service currently runs only on the staging cluster, where
`staging-coverage.airframes.io` serves the API under `/api/` and the WebSocket at `/ws`.
Point these at a production host once one exists.

`NEXT_PUBLIC_MAP_STYLE_URL` is optional. Without the API variables the build falls back to
`http://localhost:3002`, so set them for both Production and Preview.

To build the same output locally: `cd map && npm run build:static` (writes `map/out`).

### Docker

Expand Down
Loading