I published my first npm package over the weekend: github-auto-deploy.
I’ve been playing with Github Auto Deploys recently. There are a couple things I’m doing here that I think are different from the typical auto deploy workflow.
- Using the
deployment
event. Github has a way to differentiatepush
fromdeployment
. Deployments have the added benefit of depending on Github statuses, likeci/travis-ci
. Having deployments depend on a test suite is nice. - Using
git fetch && git checkout
. Instead of doing agit pull
and slowly updating files depending on the network speed, first fetch all the files and then do a quick file pointer swap to instantly update all files at once.
Example
PORT=1234 SECRET="Swifty4Lyfe" gad /var/app /var/app/bin/deploy.sh
In this example, deploy.sh
might look something like this:
npm install
service node-app restart
If you have questions or suggestions, let me know!