This guide explains how to deploy CL-web-components depending on what changed.
A media.env file must exist in the project root before
deploying to S3.
It must contain:
BUCKET_NAME
BASE_URL
DISTRIBUTION_ID
This file is included in gitignore and is not committed to git.
Use this workflow when only documentation (.md)
files have changed.
make websiteThis command:
*.md files to *.html using
PandocIf you added new files, stage them first:
git add <filename>Then commit and push:
make save msg="your commit message"make save uses git commit -am which only
commits already-tracked files. New files must be staged with
git add first.
./publish.bashThis script will prompt you:
You're in main branch
You need to pull in changes to the gh-pages branch to publish
process Y/n
Enter y to proceed.
It will:
gh-pagesUse this workflow when component code in src/
has changed and needs to be deployed to the CDN.
make buildThis command runs deno task build and bundles:
src/*.js > matching root-level .js
filesmod.js > cl-web-components.js (combined
build)./publish_to_s3.bash dry-runThis shows which files will be uploaded without making changes.
make websiteIf you added new files, stage them first:
git add <filename>Then commit and push:
make save msg="your commit message"
make saveusesgit commit -amwhich only commits already-tracked files. New files must be staged withgit addfirst.
./publish_to_s3.bashThis script:
*.js and css/*.css files/cl-webcomponents/ in the S3
bucket./publish.bashThis script will prompt you:
You're in main branch
You need to pull in changes to the gh-pages branch to publish
process Y/n
Enter y to proceed.
Use this workflow when creating a versioned GitHub release.
Edit codemeta.json and update:
make buildThis command also regenerates several files from
codemeta.json:
README.mdversion.jsCITATION.cffabout.mdmake distThis command:
dist/INSTALL.mdREADME.mdabout.mdcodemeta.jsonCITATION.cffLICENSEcl-web-components-<version>.zip
If you added new files, stage them first:
git add <filename>Then commit and push:
make save msg="your commit message"
make saveusesgit commit -amwhich only commits already-tracked files. New files must be staged withgit addfirst.
./release.bashThis script:
codemeta.jsongh CLI.zip archiveOpen the GitHub releases page and publish the draft:
https://github.com/caltechlibrary/CL-web-components/releases
| Task | Command |
|---|---|
| Compile source code | make build |
| Build documentation website | make website |
| Save and push working branch | make save msg="your message" |
| Publish docs to GitHub Pages | ./publish.bash |
| Preview S3 deployment | ./publish_to_s3.bash dry-run |
| Deploy JS to S3 and invalidate CDN cache | ./publish_to_s3.bash |
| Invalidate CDN cache only | ./invalidate_cdn.bash |
| Build distribution bundle | make dist |
| Create GitHub release | ./release.bash |