@heroku/release-static-artifacts
v1.1.1
Published
Enable static web apps to build artifacts during Heroku Release Phase and read them in web/worker/run dynos.
Downloads
304
Maintainers
Keywords
Readme
release-static-artifacts
npm module developed to support static site build in release phase. Each Heroku app release (v1
,v2
, etc.) gets its own bundle of static artifacts, based on the version number provided by Dyno Metadata.
During download, if the current release version's artifact is not found, then it will fallback to fetching the latest artifact (by S3's Last Modified property).
- use in release phase to upload from
static-artifacts/
directory - use in startup script to download into
static-artifacts/
directory
Install
npm
Add the package to the app:
npm install @heroku/release-static-artifacts
yarn
For a Yarn-managed app:
yarn --registry="https://registry.npmjs.org" add @heroku/release-static-artifacts
Usage
# Enable the library (currently Review Apps & Heroku CI are not supported)
export STATIC_ARTIFACTS_ENABLED=true
# Optional, force dynos to load the exact release version (do not fallback to latest)
export STATIC_ARTIFACTS_STRICT_MATCH=true
# AWS IAM credentials
export STATIC_ARTIFACTS_AWS_ACCESS_KEY_ID=xxxxx
export STATIC_ARTIFACTS_AWS_SECRET_ACCESS_KEY=yyyyy
# AWS S3 bucket name
export STATIC_ARTIFACTS_BUCKET=test-bucket
export AWS_REGION=us-east-1
# In Heroku release script
npx release-static-artifacts-upload
# In Heroku dyno startup script (.profile)
npx release-static-artifacts-download