Skip to content

Instantly share code, notes, and snippets.

@evenchange4
Created August 9, 2017 05:46
Show Gist options
  • Save evenchange4/e2bd5f055c4b91071ab3ce19fd0e7e5d to your computer and use it in GitHub Desktop.
Save evenchange4/e2bd5f055c4b91071ab3ce19fd0e7e5d to your computer and use it in GitHub Desktop.
Auto deployment to now.sh in CI
machine:
node:
version: 7
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@7 await-url@0.3;
now switch my-company -t $ZEIT_TOKEN;
URL="$(now deploy -t $ZEIT_TOKEN -e DB_PASSWORD=@production-db-password)";
await-url "$URL" && now alias set "$URL" my-app.com -t $ZEIT_TOKEN;
now remove my-app --yes --safe -t $ZEIT_TOKEN;
#!/usr/bin/env sh
set -eu;
npm install --global now@7 await-url@0.3;
now switch my-company -t $ZEIT_TOKEN;
URL="$(now deploy -t $ZEIT_TOKEN -e DB_PASSWORD=@staging-db-password)";
await-url "$URL" && now alias set "$URL" staging.my-app.com -t $ZEIT_TOKEN;
now remove my-app --yes --safe -t $ZEIT_TOKEN;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment