Skip to content

chore: add example workflow for cdn-deploy integration - #565

Open
LautaroPetaccio wants to merge 9 commits into
masterfrom
ci/cdn-deploy-example
Open

chore: add example workflow for cdn-deploy integration#565
LautaroPetaccio wants to merge 9 commits into
masterfrom
ci/cdn-deploy-example

Conversation

@LautaroPetaccio

@LautaroPetaccio LautaroPetaccio commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

what

An example showing how this repo (@dcl/sites) would adopt decentraland/actions/cdn-deploy in place of the current three-stage relay (oddish npm publish → static-sites-pipeline gitlab S3 upload → set-rollout-actionwebhooks-receiver).

It calls the reusable workflow decentraland/actions/.github/workflows/cdn-deploy.yml, which does checkout + Node 24 + build + upload-to-S3 (GitHub OIDC) + Cloudflare KV in one place. Adds a single file: .github/workflows/cdn-deploy.example.yml.

inert by default

Every job is gated on a CDN_DEPLOY_EXAMPLE_ENABLED repo variable (unset), so merging this deploys nothing and doesn't interfere with the live build-release.yml / set-rollout*.yml.

state-aware (no explicit modes)

The action infers the S3 work from state: it HEADs <package>/<version>/index.html and uploads if absent, copies the commit's build for a release, or skips when already there — then repoints the KV. The version is commit-deterministic (<base>-commit-<sha>), so a later run can locate and reuse a build. All envs share one S3 path; only the KV namespace differs.

the three jobs (matching today's flow)

current example job trigger what it does
build-release.yml + set-rollout.yml dev-stg push to master build once, upload, repoint zone + today from a single upload
manual org rollout after release stage-release release published stage the build under the release tag (copies the commit's already-uploaded build to the tag prefix) — no KV change
set-rollout-manual.yml manual-deploy workflow_dispatch deploy a chosen version or commit to a chosen environment (e.g. promote dev's build to stg) — repoints that env's KV

stage-release deliberately doesn't touch KV — the prod switch is the manual manual-deploy run, so going live is a deliberate, separate step.

slim config — almost nothing per repo

Each job is a few with: lines + secrets: inherit. The reusable workflow pulls everything shared from org-level config:

  • org secrets: CF_KV_API_TOKEN, ROLLOUTS_SLACK_WEBHOOK, and the KV namespace ids CF_NS_ZONE / CF_NS_TODAY / CF_NS_ORG (these live in the private sites-deployer repo, so they're not hardcoded in the action)
  • org variables: CF_ACCOUNT_ID, CDN_DEPLOY_ROLE_ARN
  • bucket / region / CDN url are defaulted in the action; package-name + deployment-path are derived from package.json

to actually adopt (not in this PR)

  1. Merge feat: add cdn-deploy action for single-step site deployments actions#17, then pin @cdn-deploy-v1 once tagged.
  2. One-time org setup (admin): the secrets + variables listed above.
  3. Set CDN_DEPLOY_EXAMPLE_ENABLED to true.
  4. Delete build-release.yml, set-rollout.yml, set-rollout-manual.yml.

Notes: deploying by commit checks the repo out at that commit to read the base version; it requires id-token: write (it confirms the build is on the CDN before repointing). One deploy runs at a time per repo (the reusable workflow sets a concurrency group).

@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sites Ready Ready Preview, Comment Jun 18, 2026 12:46pm

Request Review

shows how @dcl/sites would adopt decentraland/actions/cdn-deploy in place
of the current oddish + static-sites-pipeline + set-rollout relay, in a
single in-job step that uploads to s3 via github oidc and patches the
cloudflare kv inline.

the file is inert: every job is gated on the CDN_DEPLOY_EXAMPLE_ENABLED
repo variable (unset), so merging it does not deploy anything or interfere
with build-release.yml / set-rollout*.yml. it documents three paths:

- push to master: build once, deploy dev (zone), repoint stg (today) at
  the same bytes (one upload, kv-only for the second env)
- release published: promote the stg build to prod under the release tag
  WITHOUT rebuilding, via the redeploy s3-copy + kv repoint
- manual dispatch: rollout/rollback by moving the kv pointer (repoint)
@LautaroPetaccio
LautaroPetaccio force-pushed the ci/cdn-deploy-example branch from 0d435bc to 5cf2354 Compare June 6, 2026 21:47
@LautaroPetaccio LautaroPetaccio changed the title ci: add example workflow for cdn-deploy integration chore: add example workflow for cdn-deploy integration Jun 6, 2026
@coveralls

coveralls commented Jun 6, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27760401580

Coverage remained the same at 88.256%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 7261
Covered Lines: 6864
Line Coverage: 94.53%
Relevant Branches: 5469
Covered Branches: 4371
Branch Coverage: 79.92%
Branches in Coverage %: Yes
Coverage Strength: 14.91 hits per line

💛 - Coveralls

- actions/checkout -> df4cb1c # v6.0.3
- actions/setup-node -> 48b55a0 # v6.4.0
- add a node 24 setup step to the promote-prod and repoint jobs so the
  action runs under node 24 even though they do no checkout/build
switch the example from calling the cdn-deploy composite action directly
to the reusable workflow decentraland/actions/.github/workflows/cdn-deploy.yml,
so each path is a small with:/secrets: block:

- push -> deploy-dev (build once, zone) then deploy-stg (repoint today at
  the same version via the reusable workflow's `version` output)
- release -> promote-prod (redeploy: copy stg build to the tag, point org)
- workflow_dispatch -> repoint

still inert (gated on CDN_DEPLOY_EXAMPLE_ENABLED).
- secrets: inherit (org CF_KV_API_TOKEN / ROLLOUTS_SLACK_WEBHOOK); account id,
  role and KV namespaces come from org vars + action defaults, so the jobs
  carry almost no config
- dev-stg derives package-name/deployment-path from package.json and repoints
  zone+today from one upload
- release stages the build under the tag (deployment-environments '[]', no KV);
  manual dispatch switches a chosen env's KV
the workflow_dispatch job now deploys a chosen environment + a build picked
by version OR commit (e.g. promote dev's build to stg by its commit), on top
of the automatic push/release flow.
the KV namespace ids moved out of the action into org secrets, so the
one-time org setup now includes CF_NS_ZONE / CF_NS_TODAY / CF_NS_ORG.
…ecks out)

the reusable workflow checks out the release commit, so the copy source is
derived from the repo-root package.json; package-name is optional.
…t-path)

drop the reusable-workflow indirection: each job checks out + builds (or
checks out for the base version) and calls decentraland/actions/cdn-deploy
with dist-path, wiring the org secrets/vars and a per-repo concurrency group.
the UI owns its build artifact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants