Skip to content

ci(cdn): add workflow_dispatch trigger and PR dry-run for widget upload#45

Merged
lukeocodes merged 1 commit into
mainfrom
ci/cdn-validation-tooling
May 5, 2026
Merged

ci(cdn): add workflow_dispatch trigger and PR dry-run for widget upload#45
lukeocodes merged 1 commit into
mainfrom
ci/cdn-validation-tooling

Conversation

@lukeocodes
Copy link
Copy Markdown
Member

Summary

Two pieces of validation tooling for the CDN publish pipeline added in #44:

  • workflow_dispatch on npm-publish.yml so publish-cdn-widget can be fired manually for ad-hoc validation without waiting for a release.
  • New cdn-dryrun.yml workflow that runs on PRs touching widget/sdk/publish workflows. Uses the read-only CDN_AWS_ROLE_READER to list bucket state and aws s3 sync --dryrun against both versioned and latest paths. No writes.

Why

Validating the CDN pipeline shouldn't require cutting a real release. After this lands:

  1. To smoke-test the live publish path: trigger npm Publish manually from the Actions UI (or gh workflow run npm-publish.yml --repo deepgram/agent). It re-uploads the current packages/widget/package.json version + latest/, and invalidates /widgets/latest/*.
  2. Every PR that touches widget/sdk/publish gets a free dry-run that confirms creds work, bucket is reachable, and the planned sync makes sense.

Dispatch behaviour

On workflow_dispatch:

  • release-please runs but produces no release (no commits to release).
  • publish-sdk / publish-widget skip (gated on *--release_created).
  • publish-cdn-widget runs because the `if:` now also accepts `github.event_name == 'workflow_dispatch'`.
  • Version is resolved from `packages/widget/package.json` instead of the (empty) release-please output.

Dry-run behaviour

PRs that touch `packages/widget/`, `packages/sdk/`, `.github/workflows/cdn-dryrun.yml`, or `.github/workflows/npm-publish.yml` get a `dryrun-widget` job that:

  • Builds the widget bundle.
  • Assumes `CDN_AWS_ROLE_READER` via OIDC.
  • `aws s3 ls s3://$BUCKET/widgets/ --recursive` to surface what is already there.
  • `aws s3 sync ./packages/widget/dist/ s3://$BUCKET/widgets/v$VER/ --dryrun`
  • `aws s3 sync ./packages/widget/dist/ s3://$BUCKET/widgets/latest/ --dryrun`

No `--delete` on the dryrun (the live job keeps it). No CloudFront invalidation either (read-only role can't invalidate, and there's no actual upload to invalidate for).

Risk

Both changes are additive. Existing release flow is untouched aside from the new `if:` that adds the dispatch path; the original release-created path still works exactly as it did.

Follow-up

A matching change for ui in deepgram/ui#TBD lands the same shape for the registry upload.

Two pieces of validation tooling for the CDN publish pipeline:

1. workflow_dispatch on npm-publish.yml so the publish-cdn-widget job
   can be fired manually for ad-hoc validation. On dispatch the widget
   version is read from packages/widget/package.json (so re-upload of
   the current published version is the default behaviour). On
   release-please push the version still comes from the release-please
   output as before.

2. New cdn-dryrun.yml workflow that runs on PRs touching the widget,
   sdk, or either of the publish workflows. Authenticates via OIDC to
   the read-only github-actions-cdn-reader role, lists what is
   currently at s3://$BUCKET/widgets/, and performs aws s3 sync
   --dryrun against both the versioned and latest paths. No writes.
   Catches broken builds, missing dist artifacts, role mis-assumptions,
   and bucket-path drift before they hit a release.

Both wired against the existing org-level secrets:
CDN_AWS_ROLE_DEPLOYER (writes), CDN_AWS_ROLE_READER (reads),
CDN_AWS_REGION, CDN_S3_BUCKET, CDN_CLOUDFRONT_DISTRIBUTION_ID.
@lukeocodes lukeocodes merged commit 22e7335 into main May 5, 2026
2 checks passed
@lukeocodes lukeocodes deleted the ci/cdn-validation-tooling branch May 5, 2026 00:07
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.

1 participant