--- title: "Automated deployments of this site with Wercker" date: 2016-05-01 categories: ["Web","Continuous Deployment"] source: https://andrew-jones.com/blog/automated-deployments-of-this-site-with-wercker/ --- # Automated deployments of this site with Wercker **Update**: I'm [now using BitBucket Pipelines](/blog/moving-from-wercker-to-bitbucket-pipelines/) instead. Since moving this site to S3, I have been using a `post-commit` hook to deploy it with [s3cmd](http://s3tools.org/s3cmd), which looks like this: ``` bucket='andrew-jones.com' branch=$(git rev-parse --abbrev-ref HEAD) if [[ "$branch" == "master" ]]; then hugo echo "Syncing public/* with s3://$bucket." s3cmd --acl-public --no-delete-removed --no-progress --cf-invalidate --acl-public sync public/* s3://$bucket echo -e "\nUpdated s3://$bucket." fi ``` That worked OK, but it's not great that it depends on my environment. I use two computers and want to be able to update this site from either of them, and I want to ensure they are built in exactly the same way with the same versions of [Hugo](https://gohugo.io/) and s3cmd. So I looked around for a cloud hosted continuous delivery platform and eventually came across [Wercker](http://wercker.com). It's a [Docker](http://docker.com) based service that is fully integrated with [Bitbucket](http://bitbucket.org) (where I host my repository), and has an impressive free plan. Specifying the build steps is done using a simple yaml file, and by [following this guide on the hugo website](https://gohugo.io/tutorials/automated-deployments/) I got it up and running in no time, swapping the Git pages deploy step with this: ``` deploy: steps: - arjen/s3sync@2.0.4: key-id: $KEY key-secret: $SECRET bucket-url: s3://andrew-jones.com source-dir: public delete-removed: false opts: --no-delete-removed --no-progress --cf-invalidate --acl-public ``` I'm very impressed with Wercker - it couldn't have been easier to get this done. Look forward to using it for more of my personal projects.