An example of a dynamic 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 a build env var:
And a runtime env:
NPM_TOKEN is used to authenticate with the npm registry to be
able to download private repositories.
TEXT is used to respond to all incoming HTTP requests.
.dockerignore is used in order to only upload files into the build
stage that are necessary for this project to work.