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
deploymentevent. Github has a way to differentiate
deployment. Deployments have the added benefit of depending on Github statuses, like
ci/travis-ci. Having deployments depend on a test suite is nice.
git fetch && git checkout. Instead of doing a
git pulland 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.
PORT=1234 SECRET="Swifty4Lyfe" gad /var/app /var/app/bin/deploy.sh
In this example,
deploy.sh might look something like this:
service node-app restart
If you have questions or suggestions, let me know!