Skip to content

Instantly share code, notes, and snippets.

@mihaiserban
Created October 5, 2018 09:11
Show Gist options
  • Save mihaiserban/73a6a80256182f76f8c3ec5d07d7fcb4 to your computer and use it in GitHub Desktop.
Save mihaiserban/73a6a80256182f76f8c3ec5d07d7fcb4 to your computer and use it in GitHub Desktop.
Auto deployment to now.sh from Circle CI
machine:
node:
version: 8
deployment:
staging:
branch: master
owner: my-company
commands:
- ./deploy-staging.sh
production:
tag: /v[0-9]+(\.[0-9]+)+/
owner: my-company
commands:
- ./deploy-production.sh
#!/usr/bin/env sh
set -eu;
npm install --global now@9 [email protected];
URL="$(now deploy --env=DB_PASSWORD=@production-db-password --team=my-team --token=$ZEIT_TOKEN)";
await-url "$URL";
now alias set "$URL" my-app.com --team=my-team --token=$ZEIT_TOKEN;
now remove my-app --yes --safe --team=my-team --token=$ZEIT_TOKEN;
#!/usr/bin/env sh
set -eu;
npm install --global now@9 [email protected];
URL="$(now deploy --env=DB_PASSWORD=@staging-db-password --team=my-team --token=$ZEIT_TOKEN)";
await-url "$URL";
now alias set "$URL" staging.my-app.com --team=my-team --token=$ZEIT_TOKEN;
now remove my-app --yes --safe --team=my-team --token=$ZEIT_TOKEN;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment