Auto deploy (#159)

* Auto-deploy + Slack message

- Ignore WIP

* Only run for PRs
main
Michael Fix 7 years ago committed by GitHub
parent a394079b2a
commit b6be5344bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,7 +4,15 @@ cache:
yarn: true
directories:
- node_modules
before_install:
- chmod +x bin/deploy.sh
install:
- yarn
script:
- yarn lint
- bash ./bin/deploy.sh
env:
global:
- secure: n6rdYtl9HwHzfgKcG79UWWL4ncKI0LKpJmEiuWAaS/SmNAUDrMVHLZZ6SMGxVaUi3B66QRmoa0gcm6u+LZeVO3twiHQ57TcjWNiR/Nug9Ff+hnvO1ydoGuPk74OIG8GYUMKLI5JSf0/ANnWPeWvZkPAmUAc1L4kyqbdTxFPx91KLLKR6XJTiMhU6hmfiQSxlaiEnvbXR7zCiiwq43IBulPrjXNfnPKN9tD4SqxwuCP3CGxlPE7RnwQ5S1bnozfKAK+LliLkGor0K9Wh71enTLOzcMenQL+7bqNdo8JwAvPlfaGO+mEIWc/tE1ya3WBVXGqEsFADi10oZG1HH9jMkzi6/y3W/FoK0tZ4JCGz3nRRQiMUai6h7V0DUthd6QKN3TXlC8MXfNGY30ur8guy7u920uKd5F71yTF11QPCwtUJyAKlLnlHF1GZdDbVMyA5fr9dNvS6VA4rwuWRrAjDz923NFBy4bQhPisxF2rOuzqgVvzNpmIlUhyGbeuRtLxIz8Cs/HXuwsiAANYabb7Cxe7He9jx3/DL27LODJkIaYwJKGo9AAfC6cfG60b/fXlZhRzoxTjHkHD9Qf/6X/fhVw43S1ha+kM4YJR88k4A3VFcH7msrHRmvij3LIdjkMmROFzfrSQwGU4RRuQ3qhqr5Kc7t2MVQRYJvA2cQ/qrr4fM=
- secure: XMc4M3OMKL9epG6SskiqqRFRh9BCSK7GoApUX+j0eh4Q0rDzKrM5LwzgJWTIqlLkg5iaJwcny0uRUBazQcFzIgn4/30I0NnW56zqx5uNnzLogx/HszkY+gaDfbjUdwa0UA7tmGdr+obxBT/MYSv2tIuwn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w12e0/nF97cBoG+MQX0mR6PpXl4dF34tVG/yYQSH6IfLgY+0KF55JRoF/usPOegKeO+DST+Q9JB94dTNHfkf4+jWmJK6uHj8ocQOzXHhydVLgHREUAxAtrOJS+rpm4dTo=

@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Don't deploy if commit contains WIP
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [[ $(git log -1 --pretty=%B --no-merges) != *"WIP"* ]]; then
NOW_URL=$(now -e NODE_ENV=production --public --no-clipboard --team=dawn --token "$NOW_TOKEN")
curl -X POST \
-H 'Content-type: application/json' \
--data "{\"text\": \":small_red_triangle: New Carbon PR Deployment for <https://github.com/dawnlabs/carbon/pulls/$TRAVIS_PULL_REQUEST|PR #$TRAVIS_PULL_REQUEST>\\n:rocket: $NOW_URL\"}" \
"$DAWN_SLACK_WEBHOOK"
fi
fi

@ -7,7 +7,7 @@
"dev": "node server.js",
"build": "next build",
"start": "cross-env NODE_ENV=production node server.js",
"deploy": "now --public",
"deploy": "now --public -e NODE_ENV=production",
"prettier": "prettier --config .prettierrc --write *.js {components,handlers,lib,pages}/*.js",
"lint": "prettier --config .prettierrc *.js {components,handlers,lib,pages}/*.js",
"precommit": "npm run contrib:build && git add README.md && lint-staged",

Loading…
Cancel
Save