Publish components to S3 from Actions - #52
Merged
Conversation
t4k
force-pushed
the
ci/publish-to-s3
branch
3 times, most recently
from
September 2, 2026 21:29
9820417 to
71a04dc
Compare
publish_to_s3.bash needed an uncommitted media.env on someone's machine, so whether the CDN was current depended on who had run it lately. Nobody had since July 2025: the CDN copy served version 0.0.12 while the project was at 0.0.16 and the documentation site served the current build. The workflow authenticates with OIDC, so no AWS keys exist in the repository or on anyone's machine. It runs when a release is published, and manually from the Actions tab with a dry run by default. Two fixes come from the shared action rather than from here. invalidate_cdn.bash invalidated /*, taking out every other project on the distribution; the action scopes invalidation to this project's prefix. And the old script inferred content types itself, which is why some files were served as the wrong type. sources is just dist. Component stylesheets build into it alongside the bundles, and the docs theme's CSS is no longer this project's to publish. The prefix stays cl-webcomponents, without the dash. It reads like a typo but it is where the objects are; cl-web-components returns 404. Correcting it means migrating, which belongs with the move to a versioned asset domain. The eleven bundles committed in the repository root go too. They existed to be uploaded by publish_to_s3.bash and nothing else read them: the documentation site takes its bundles from dist/ via the build, the demo pages resolve against the site root rather than the repository, and make dist zips from dist/. Their last consumer is deleted here, so they follow. mod.js stays -- it is authored source that imports from src/, not build output. docs/DEPLOYMENT.md described the manual path step by step and is rewritten to match. The release section still describes make dist and release.bash, which stay until that work lands.
t4k
force-pushed
the
ci/publish-to-s3
branch
from
September 2, 2026 21:50
71a04dc to
071e1bd
Compare
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.
Replaces
publish_to_s3.bashandinvalidate_cdn.bash.What was wrong
The old script needed an uncommitted
media.envto exist on someone’s machine,so whether the CDN was current depended on who had run it lately. Nobody had
since July 2025:
media.library.caltech.edu/cl-webcomponents/(CDN copy)9729d57software.library.caltech.edu/CL-web-components/(Pages, rebuilt every push)invalidate_cdn.bashalso invalidated/*— every other project on thatdistribution, not just this one.
What replaces it
.github/workflows/publish-to-s3.yml, callingcaltechlibrary/workflows/.github/actions/publish-to-s3@v1. Authentication isOIDC, so no AWS keys exist in this repository or on anyone’s machine.
Runs when a release is published, and manually from the Actions tab with
dry_runon by default — that reports exactly what would be uploaded andinvalidated without touching anything.
Two fixes come from the shared action rather than from here: invalidation is
scoped to this project’s prefix, and content types are set explicitly rather
than guessed.
sources: distJust
distnow. Component stylesheets build into it alongside the bundles as of#50, and the docs theme’s CSS is no longer this project’s to publish — that
moved to
caltechlibrary/workflowsin its v1.2.0.A side effect worth noting:
textarea-agent-list.cssgets published for thefirst time.
css-hrefis a documented consumer feature and its defaultstylesheet has been returning 404 on both hosts.
The prefix stays
cl-webcomponentsNo dash between "web" and "components". It reads like a typo, but it is where
the objects are:
Changing it would publish to a new empty path rather than update what consumers
load. Correcting the spelling means migrating, which belongs with the eventual
move to a versioned asset domain.
The eleven root bundles go too
They existed to be uploaded by
publish_to_s3.bash, and nothing else readthem. Verified before deleting:
docs.ymlincludesdist/*.js,dist/*.css,mod.js,LICENSE,src—not the repository root
src="textarea-csv.js", whichresolve against the published site root, where
dist/*.jslands — notagainst the repository
Makefile:81doescd dist && zip …, somake distzips fromdist/deno.jsononly referencessrc/*.jsanddist/Their last consumer is deleted in this change, so they follow it.
mod.jsstays. It is authored source that imports fromsrc/, and the siteincludes it deliberately.
Documentation
docs/DEPLOYMENT.mdwalked through the manual path step by step and isrewritten to match: merge, the docs site rebuilds itself, the CDN updates on
release or on a manual dispatch.
Its release section still describes
make distandrelease.bash. Those stayuntil the release workflow lands, so that section is deliberately untouched.
Before merging
Worth one manual dispatch with
dry_runchecked, to confirm the OIDC role andthe file list before anything real is written.