You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: proxy content from the netlify service (#219)
## Summary
This PR reworks the containers and their configuration to ensure we
proxy the service from content coming from Netlify instead of the GCS
bucket.
- Adds a new workflow to allow users to manually invalidate the GCP CDN
- nginx configuration will now source content from Netlify
- nginx configuration will rewrite host and /developer path
appropriately
- Cleans up some legacy functionality
---
This pull request refactors the deployment pipeline for the
`/developers` site by switching from serving static files from GCS to
proxying requests to the Netlify deployment via an NGINX container on
Cloud Run. It also separates CDN cache invalidation into a dedicated
workflow and simplifies the NGINX setup. The most important changes are:
**Deployment workflow changes:**
*
[`.github/workflows/deploy_gcs.yml`](diffhunk://#diff-1b4b1ebc2bdf979ebb337fbe79c15e0a7032d263c9252e0c5c584b213052f21bL1-L25):
The workflow is renamed to "Deploy nginx proxy to Cloud Run" and now
only triggers when files in `ci/nginx-rewrite/**` are changed. The build
and deploy steps for the static site to GCS are removed, as well as the
CDN cache invalidation step. The workflow now builds and deploys only
the NGINX container.
[[1]](diffhunk://#diff-1b4b1ebc2bdf979ebb337fbe79c15e0a7032d263c9252e0c5c584b213052f21bL1-L25)
[[2]](diffhunk://#diff-1b4b1ebc2bdf979ebb337fbe79c15e0a7032d263c9252e0c5c584b213052f21bL35-L43)
[[3]](diffhunk://#diff-1b4b1ebc2bdf979ebb337fbe79c15e0a7032d263c9252e0c5c584b213052f21bL62-L67)
**CDN cache invalidation:**
*
[`.github/workflows/invalidate-cdn.yml`](diffhunk://#diff-681d70fc4853c54f2e376212d8332d7fef902c66953f0c10caa1888da8bf2525R1-R25):
A new workflow is added to handle CDN cache invalidation for
`/developers/*` as a separate, manually-triggered job.
**NGINX container and proxy configuration:**
*
[`ci/nginx-rewrite/Dockerfile`](diffhunk://#diff-0467814882cf41c18f620d6146df7793a7b00b70f7da33cbfbea3dded974b441L1-R4):
The multi-stage build that fetched static content from GCS is removed.
The container now installs `ca-certificates` for SSL proxying and no
longer copies content to the image.
*
[`ci/nginx-rewrite/nginx.conf`](diffhunk://#diff-e84347fcb0b04b6e8fc158235bf34afb0ed65d5cec7e22cce739716a347b347aL26-R47):
The server no longer serves static files from the container. Instead,
all `/developers/` requests are proxied to the Netlify deployment, with
appropriate headers and SSL verification.
*
[`ci/nginx-rewrite/Dockerfile`](diffhunk://#diff-0467814882cf41c18f620d6146df7793a7b00b70f7da33cbfbea3dded974b441L19-R13):
File and directory permissions are updated to remove ownership changes
for the now-unused static content directory.
Copy file name to clipboardExpand all lines: README.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,18 +81,21 @@ This project has two deployment mechanisms:
81
81
82
82
Every pull request automatically generates a preview deployment on Netlify at `https://deploy-preview-{PR_NUMBER}--developers-preview.netlify.app/developers/`. This allows reviewers to see changes before they're merged. The Netlify configuration is defined in `netlify.toml`.
83
83
84
-
### Production Deployments (Google Cloud Storage)
84
+
### Production Deployments (Netlify + GCP proxy)
85
85
86
-
The real production deployment is served through Google Cloud Storage (GCS) at `https://interledger.org/developers/`as part of the main Interledger website. This is a transparent proxy configuration - the developers portal is hosted separately but appears as part of the main domain.
86
+
The production site is built and hosted on Netlify, but users access it at `https://interledger.org/developers/`via the main Interledger load balancer. A small nginx service on Cloud Run proxies `/developers/*` requests from the GCP load balancer to the Netlify-hosted site, so the browser URL stays on `interledger.org`.
87
87
88
-
When a PR is merged to the `main` branch, the `.github/workflows/deploy_gcs.yml` GitHub Actions workflow automatically:
88
+
When a PR is merged to `main`, Netlify builds and publishes the new site automatically. GCP's Cloud CDN sits in front of the nginx proxy and caches responses for up to 1 hour.
89
89
90
-
1. Builds the site using Bun
91
-
2. Deploys the built files to Google Cloud Storage (`gs://interledger-websites-public/developers`)
92
-
3. Rebuilds and deploys the nginx-rewrite Cloud Run service (which handles the `/developers` proxy routing)
93
-
4. Invalidates the CDN cache to ensure new content is served immediately
90
+
#### Invalidating the CDN after a deploy
94
91
95
-
**Note:** There is a legacy `deploy.yaml` workflow in `.github/workflows/` which is being deprecated. New deployments should use `deploy_gcs.yml`.
92
+
Because GCP Cloud CDN caches `/developers/*`, newly deployed content may take up to an hour to appear on `interledger.org/developers/`. If you need changes to go live immediately, manually trigger the **Invalidate CDN** workflow:
93
+
94
+
1. Go to the repo's **Actions** tab on GitHub.
95
+
2. Select the **Invalidate CDN** workflow.
96
+
3. Click **Run workflow** on the `main` branch.
97
+
98
+
This runs `gcloud compute url-maps invalidate-cdn-cache` against `/developers/*` and typically propagates within a minute.
96
99
97
100
For more information about the main Interledger.org infrastructure and deployment pipeline, see the [`interledger.org-v4`](https://github.com/interledger/interledger.org-v4) repository.
0 commit comments