This guide explains how the JSON Schemas are published to
https://schemas.projections.githubnext.com/ and what infrastructure needs to
be provisioned before the first release goes out. See
Versioning and publishing for the
URL structure and compatibility policy.
.github/workflows/publish-schemas.yml runs as a dist post-announce job (listed
under post-announce-jobs in dist-workspace.toml), right after the release
workflow announces a release. You can also run it manually from the Actions tab
— useful for republishing or for the initial publish right after provisioning —
by choosing the release tag under Use workflow from and passing it as tag.
The workflow runs three steps:
- Validate the committed schemas. It runs
node packages/schemas/scripts/publication.mjs(the same checknpm testruns) to verify every$idand$refpoints to the schemas host, every reference resolves, and the committed files match what the TypeBox sources generate. - Upload immutable snapshots. Each schema is uploaded to
<name>/v<major>/<release>.jsonwith a one-year immutable cache header. Snapshots are never overwritten — if a snapshot already exists with different content, the job fails. - Update the rolling major-version files. For stable releases (any version
without a prerelease suffix, such as
0.2.0), it updates each<name>/v<major>.jsonwith a five-minute cache header. Prereleases like0.3.0-beta.1only write snapshots.
The workflow never deletes blobs. Until the repository variables below are configured, it simply logs a notice and exits cleanly.
-
Storage account. Create a StorageV2 account (
Standard_LRSis plenty) with static website hosting enabled. Releases upload to its$webcontainer. Because a static website endpoint serves files anonymously even when public blob access is disabled, keep Allow Blob anonymous access off and disable shared key access. -
Front Door (Standard). Create a profile and endpoint whose origin is the storage account's static website host (
<account>.z<N>.web.core.windows.net), using HTTPS only. Enable caching with Use origin cache-control headers so each blob'sCache-Controlheader takes effect. Add a rule set on the route that overwrites these response headers:Access-Control-Allow-Origin: *Cross-Origin-Resource-Policy: cross-originX-Content-Type-Options: nosniff
Content types come straight from the blobs (
application/schema+json). -
Custom domain. Attach
schemas.projections.githubnext.comto the endpoint with a Front Door managed certificate. -
Publishing identity. Create a Microsoft Entra app registration (or user-assigned managed identity) with a federated credential for GitHub Actions using issuer
https://token.actions.githubusercontent.com, subjectrepo:<owner>/<repository>:environment:schemas, and audienceapi://AzureADTokenExchange. Assign it Storage Blob Data Contributor on the storage account (or scoped to its$webcontainer). No secrets are stored; the workflow authenticates via OpenID Connect.
- Add a
CNAME schemas.projections.githubnext.comrecord pointing to the Front Door endpoint host (<endpoint>-<hash>.z01.azurefd.net). - Add the
TXT _dnsauth.schemas.projections.githubnext.comrecord that Front Door provides to validate domain ownership.
-
Create an environment named
schemasand restrict its deployments to release tags (selected tags such asv*) so only releases can publish. -
Add the following repository variables under Settings → Secrets and variables → Actions → Variables (none of these are secrets):
Variable Value SCHEMAS_AZURE_CLIENT_IDThe publishing identity's client ID SCHEMAS_AZURE_TENANT_IDIts tenant ID SCHEMAS_AZURE_SUBSCRIPTION_IDThe storage account's subscription SCHEMAS_STORAGE_ACCOUNTThe storage account name SCHEMAS_STORAGE_CONTAINEROptional: the container, $webby default
Once provisioning is done, trigger Publish schemas with the latest release tag, then check the live response headers:
curl -sI -H 'Origin: https://vscode.dev' https://schemas.projections.githubnext.com/extraction/v0.jsonYou should see status 200, content-type: application/schema+json,
access-control-allow-origin: *, and cache-control: public, max-age=300.
Checking a versioned snapshot such as …/extraction/v0/0.2.0.json should return
cache-control: public, max-age=31536000, immutable.