chore: add example workflow for cdn-deploy integration - #565
Open
LautaroPetaccio wants to merge 9 commits into
Open
chore: add example workflow for cdn-deploy integration#565LautaroPetaccio wants to merge 9 commits into
LautaroPetaccio wants to merge 9 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
force-pushed
the
ci/cdn-deploy-example
branch
from
June 6, 2026 21:47
0d435bc to
5cf2354
Compare
Coverage Report for CI Build 27760401580Coverage remained the same at 88.256%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
An example showing how this repo (
@dcl/sites) would adoptdecentraland/actions/cdn-deployin place of the current three-stage relay (oddish npm publish →static-sites-pipelinegitlab S3 upload →set-rollout-action→webhooks-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_ENABLEDrepo variable (unset), so merging this deploys nothing and doesn't interfere with the livebuild-release.yml/set-rollout*.yml.state-aware (no explicit modes)
The action infers the S3 work from state: it HEADs
<package>/<version>/index.htmland 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)
build-release.yml+set-rollout.ymldev-stgmasterorgrollout after releasestage-releaseset-rollout-manual.ymlmanual-deployworkflow_dispatchstage-releasedeliberately doesn't touch KV — the prod switch is the manualmanual-deployrun, 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:CF_KV_API_TOKEN,ROLLOUTS_SLACK_WEBHOOK, and the KV namespace idsCF_NS_ZONE/CF_NS_TODAY/CF_NS_ORG(these live in the privatesites-deployerrepo, so they're not hardcoded in the action)CF_ACCOUNT_ID,CDN_DEPLOY_ROLE_ARNpackage-name+deployment-pathare derived frompackage.jsonto actually adopt (not in this PR)
@cdn-deploy-v1once tagged.CDN_DEPLOY_EXAMPLE_ENABLEDtotrue.build-release.yml,set-rollout.yml,set-rollout-manual.yml.Notes: deploying by
commitchecks the repo out at that commit to read the base version; it requiresid-token: write(it confirms the build is on the CDN before repointing). One deploy runs at a time per repo (the reusable workflow sets aconcurrencygroup).