Skip to content

Commit 66b034e

Browse files
chore(deploy): retire AWS/GCP pipeline; deploy production on release tags
The apex has served from the Cloudflare worker since the 2026-07-08 cutover, so the nginx image and the AWS ECS / GCP deploy workflows no longer serve anything — they existed as the rollback path during the soak. Merging this ends that soak: rollback afterwards means redeploying an older worker version, not repointing at AWS. deploy.yml gains the @polygonlabs/meta release-tag trigger, deferred from the cutover PRs until wrangler owned the domain: production now deploys in lockstep with the npm publish, so the CDN and the package (two surfaces of one network/ tree) cannot drift. Merging the Version Packages PR is the deliberate promote-to-prod step; push-to-master still deploys staging and dispatch remains the escape hatch. Also collapses the cutover-era comments in wrangler.toml and CLAUDE.md to the steady state, pointing at the apps-team-ops service-hosting-migration runbook for the migration process itself. A root CHANGELOG.md is introduced with this as its 1.0.0 entry, documenting the endpoint's consumer-visible changes (Cloudflare hosting, real 404s, read-only CORS surface, cache header, /network/index.js removal).
1 parent a57a5e4 commit 66b034e

14 files changed

Lines changed: 123 additions & 235 deletions

.github/taskdef/dev-taskdef.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/taskdef/prod-taskdef.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/taskdef/staging-taskdef.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/build_and_deploy.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,23 @@ name: Deploy to Cloudflare
33
# Trunk-based deployment. master is the only branch.
44
#
55
# - staging: every push to master (trunk) deploys staging
6-
# (static-cf.polygon.technology, a custom_domain on a fresh
7-
# hostname). Trunk is always deployable, so staging tracks trunk.
8-
# - production: workflow_dispatch ONLY, for now. The apex cutover sequence is
9-
# documented in wrangler.toml [env.production]: dispatch once to
10-
# create the worker → land custom_domain → SPEC swaps DNS in the
11-
# CF dashboard → dispatch to verify ownership. The ordering makes
12-
# a stray production dispatch harmless at every step. Once the
13-
# domain is wrangler-owned, re-add a release-tag trigger here so
14-
# prod auto-deploys on each @polygonlabs/meta release.
6+
# (static-staging.polygon.technology). Trunk is always deployable, so
7+
# staging tracks trunk.
8+
# - production: the @polygonlabs/meta release tag, pushed by the release bot
9+
# when the Version Packages PR merges, deploys production
10+
# (static.polygon.technology) in lockstep with the npm publish.
11+
# The CDN and the npm package serve the same network/ tree, so
12+
# gating prod on the release keeps them from drifting; merging
13+
# the Version Packages PR is the deliberate promote-to-prod step.
14+
# (The release commit also re-deploys staging — a harmless
15+
# idempotent no-op.)
16+
# - dispatch: manual escape hatch for either env (rollback / re-deploy).
1517
on:
1618
push:
1719
branches:
1820
- master
21+
tags:
22+
- '@polygonlabs/meta@*'
1923
workflow_dispatch:
2024
inputs:
2125
environment:
@@ -50,12 +54,32 @@ jobs:
5054

5155
- run: pnpm install --frozen-lockfile
5256

53-
# dispatch → chosen env; a push to master → staging.
54-
- run: >
55-
pnpm exec wrangler deploy --env ${{
56-
github.event_name == 'workflow_dispatch' && github.event.inputs.environment
57-
|| 'staging'
58-
}}
57+
# dispatch → chosen env; a tag push → production; a push to master → staging.
58+
# Deliberately plain bash rather than a ${{ }} ternary chain: GitHub
59+
# expression short-circuiting silently falls through when a middle operand
60+
# is falsy (e.g. an empty dispatch input), and shell if/else has no such
61+
# trap. Anything unexpected exits 1 instead of deploying somewhere.
62+
- name: Resolve target environment
63+
id: target
64+
env:
65+
DISPATCH_ENV: ${{ github.event.inputs.environment }}
66+
run: |
67+
if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
68+
case "$DISPATCH_ENV" in
69+
staging|production) ENV="$DISPATCH_ENV" ;;
70+
*) echo "Unexpected dispatch environment: '$DISPATCH_ENV'" >&2; exit 1 ;;
71+
esac
72+
elif [ "$GITHUB_REF_TYPE" = "tag" ]; then
73+
ENV="production"
74+
elif [ "$GITHUB_REF" = "refs/heads/master" ]; then
75+
ENV="staging"
76+
else
77+
echo "Unexpected ref for deploy: $GITHUB_REF ($GITHUB_REF_TYPE)" >&2; exit 1
78+
fi
79+
echo "resolved: $GITHUB_EVENT_NAME $GITHUB_REF -> $ENV"
80+
echo "environment=$ENV" >> "$GITHUB_OUTPUT"
81+
82+
- run: pnpm exec wrangler deploy --env ${{ steps.target.outputs.environment }}
5983
env:
6084
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_WORKER_ACCOUNT_ID }}
6185
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_WORKER_API_TOKEN }}

.github/workflows/deployment.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/deployment_gcp.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Changelog
2+
3+
Repo-level changelog for the `static.polygon.technology` HTTP endpoint and the
4+
repository's tooling. The `@polygonlabs/meta` npm package has its own
5+
changesets-managed changelog at
6+
[`packages/meta/CHANGELOG.md`](./packages/meta/CHANGELOG.md).
7+
8+
## 1.0.0 — 2026-07-08
9+
10+
First changelog entry, marking the endpoint's move to Cloudflare.
11+
12+
### Changed
13+
14+
- `static.polygon.technology` is now served from Cloudflare Workers static
15+
assets. The nginx Docker image and its AWS ECS / GCP deploy pipelines are
16+
removed (`Dockerfile`, `nginx.conf`, `deployment.yml`, `build_and_deploy.yml`,
17+
`deployment_gcp.yml`, `.github/taskdef/`). The image was internal deploy
18+
tooling only — it was never published to a public registry. Self-hosting the
19+
content needs nothing more than a static file server pointed at `network/`;
20+
the retired nginx setup remains available in git history.
21+
- Deployment is trunk-based via `wrangler` (`.github/workflows/deploy.yml`):
22+
pushes to `master` deploy staging (`static-staging.polygon.technology`), and
23+
`@polygonlabs/meta` release tags deploy production, in lockstep with the npm
24+
publish.
25+
- Missing paths now return a real `404`. The retired nginx config served the
26+
health-check HTML page with `200` for any unknown path.
27+
- CORS advertises the endpoint's actual read-only surface:
28+
`Access-Control-Allow-Methods: GET, OPTIONS` (previously also `POST`, plus
29+
`Authorization`/`Content-Type` allow-headers for a write/auth surface that
30+
never existed).
31+
- Responses now carry `Cache-Control: public, max-age=300`.
32+
33+
### Removed
34+
35+
- `/network/index.js` (a CommonJS `Network` class predating the
36+
`@maticnetwork/meta` 2.x package split) is no longer served. Use the
37+
[`@polygonlabs/meta`](./packages/meta/) npm package for typed access, or
38+
fetch the JSON tree directly.

CLAUDE.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,30 @@ Two public surfaces driven from one source JSON tree at the repo-root
3030
live in `public/_headers`.
3131

3232
`deploy.yml` is trunk-based: every push to `master` deploys
33-
**staging** (`static-cf.polygon.technology`, a `custom_domain` on a
34-
fresh hostname, where wrangler can create the DNS record itself).
35-
**Production** is `workflow_dispatch`-only. The apex cannot be bound
36-
from CI while its externally-managed record exists — `custom_domain`
37-
fails with Cloudflare error 100117, our CI token lacks
38-
`Zone:DNS:Edit` to override, and zone routes fail likewise (SPEC has
39-
tried) — so the cutover is the four-step process documented in
40-
`wrangler.toml` `[env.production]`: dispatch to create the worker,
41-
land `custom_domain = true`, SPEC swaps the DNS record onto the
42-
worker in the CF dashboard (zero downtime), dispatch to verify
43-
wrangler owns the domain. The ordering makes a stray production
44-
dispatch harmless at every step. Once ownership is verified, a
45-
release-tag trigger can be re-added so prod auto-deploys on each
46-
`@polygonlabs/meta` release. See the apps-team-ops
47-
Cloudflare-migration runbook for the full rationale.
48-
49-
The legacy nginx-on-ECS origin (`Dockerfile`, `nginx.conf`,
50-
`deployment.yml`, `build_and_deploy.yml`) and the staged GCP path
51-
(`deployment_gcp.yml`) are kept as rollback until the apex DNS is
52-
cut over to Cloudflare, then removed in a follow-up PR. The apex DNS
53-
cutover and the AWS/GCP teardown are manual infra steps.
33+
**staging** (`static-staging.polygon.technology`); the `@polygonlabs/meta`
34+
release tag (pushed by the release bot when the Version Packages PR
35+
merges) deploys **production** (`static.polygon.technology`) in
36+
lockstep with the npm publish — merging that PR is the deliberate
37+
promote-to-prod step, and gating prod on the release keeps the CDN
38+
and the npm package (two surfaces of one `network/` tree) from
39+
drifting. `workflow_dispatch` is the manual escape hatch for either
40+
environment.
41+
42+
If this hostname (or any live hostname) ever needs to move to a
43+
different host, follow the apps-team-ops `service-hosting-migration`
44+
runbook — wrangler cannot bind a hostname whose DNS record already
45+
exists elsewhere, and the working process is documented there.
46+
47+
## Changelog
48+
49+
Maintain the root [`CHANGELOG.md`](./CHANGELOG.md) whenever a change
50+
fundamentally alters the repository's capabilities — what the running
51+
service serves or how (endpoint behaviour, status codes, headers, paths
52+
added/removed), the API surface consumers depend on, or the deployment/
53+
hosting mechanism that drives the static site. It is hand-maintained and
54+
scoped to the repo/HTTP endpoint; routine content updates under
55+
`network/` don't need an entry, and `packages/meta` has its own
56+
changesets-managed changelog.
5457

5558
## Codegen flow
5659

Dockerfile

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)