After reading Evan Browns post Hugo on the go I was inspired to figure out how to do this exact same thing but as opposed to using AWS I wanted to use Rackspace Cloud FIles and more specfically Rackspace Static Website feature, because Rackspace Cloud Files is an inexpensive way to store and distribute objects, the Cloud Files static website feature coupled with the lightning-fast content delivery network (CDN) is a winning combination in terms of both performance and price.
Creating a static website—a site that does not change for each request—with Cloud Files and the updated Control Panel is as easy as pointing and clicking.
To set up a static webiste using the Rackspace Control Panel
In the Control Panel, you begin to set up your static website by creating a container.
- Login to the Control Panel
- In the Files section of the Control Panel, click Create Container
- Fill in a name and a region for your static webite.
- For Type, select Static Website.
- Click Create Container
- In the Control Panel, click on your static website container, and then click the Upload Files button.
- In the File Upload dialog box, click Choose Files and navigate to the folder with your content.
- Select your content (you can select multiple files), and then click Open.
- In the Control Panel, navigate to your container listing by clicking the Containers link.
- Click the cog wheel next to your static website container, and then click View All Links.
All the CDN URLs for your container are displayed. For HTML pages and pictures, use the HTTP link for your static website container.
To set up a Automated Deployments using Travis CI
Once again my .travis.yml file was very similar to Evan Browns except im using a few pieces to talk to rackspace’s cloud -
language: go go: - 1.4 install: - go get github.com/spf13/hugo script: hugo before_deploy: cd public deploy: provider: cloudfiles username: RACKSPACE USERNAME api_key: secure: APIKEYFROMRACKSPACE region: REGION container: CONTAINERNAME skip_cleanup: true on: repo: caseyCaseybecking/www_caseybecking_com_hugo
- Login to the Control Panel and goto Account Settings
- Under Login Details you will see API KEY - Copy That
- Install the Travis CLI
- CD into your current hugo working directory
travis setup cloudfilesThis will ask you a few questions for setup and create the .travis.yml
Once this file is created you can push it to your repo (modification may be needed).
Now withing Travis you should be able to view the repo within My Repositories flip the switch so it is enabled and it should try to build.