An example of a static deployment built using private npm modules.
How to use
Create a readonly npm token:
npm token create --read-only
Create a secret with its value (in this example we call it
# replace "MY_TOKEN_VALUE" with the value returned # by the `npm token` command now secret add npm-token MY_TOKEN_VALUE
Add a private repo (if you have any):
yarn add @my-team/private-repo
Then you are ready to deploy!
Note: this deployment is set to have its source code be public. If
you intend for it to be private, set
public: false in
How it Works
now.json we defined to build env vars:
NPM_TOKEN is used to authenticate with the npm registry to be
able to download private repositories.
TEXT is used to generate a dynamic
index.html file that
gets placed in
/public, which is served statically once
the build completes and your deployment is ready.
.dockerignore is used in order to only upload files into the build
stage that are necessary for this project to work.