@sailci/psx-components-zeit-now

The ZeitNow component is a simple wrapper around the Zeit now CLI.

Usage no npm install needed!

<script type="module">
  import sailciPsxComponentsZeitNow from 'https://cdn.skypack.dev/@sailci/psx-components-zeit-now';
</script>

README

ZeitNow

Overview

The ZeitNow component is a simple wrapper around the Zeit now CLI.

Valid Props

Name Type Example Notes
token string $ZEIT_TOKEN Should be a valid Zeit token
alias ?string domain Your domain name to alias deployment
paths ?string | ?Array<string> public Path to folder for deployment

You can also pass any of the many options that you normally would to the Now CLI for deploying and aliasing. For the env option, just like token, any value beginning with $ will be substituted for its value from the current environment variables so you can keep them secret.

Example Usage

Generate a secret using sail secret.

<pipeline>
  <environment>
    <variable secret name="MONGO_URL" value="generated-secret-value" />
    <variable secret name="MY_API_TOKEN" value="generated-secret-value" />
    <variable secret name="ZEIT_TOKEN" value="generated-secret-value" />
  </environment>
  <job image="node:9.2.1-alpine">
    <ZeitNow
      env={{ MONGO_URL: '$MONGO_URL', MY_API_TOKEN: '$MY_API_TOKEN' }}
      paths="./public"
      public
      regions="bru,sfo"
      token="$ZEIT_TOKEN"
      alias="my-domain.now.sh"
    />
  </job>
</pipeline>