Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

parsiya.net Deploy Blog

This is the source for my personal website at https://parsiya.net.

It is generated using Hugo and the Hugo-Octopress Theme. I ported the Octopress classic theme to Hugo.

Workflow

  1. Create a new post with hugo new post/2018-11-23-post-name/index.markdown (or index.md).
  2. Edit the post and proofread with hugo serve -vw. Pictures are in the same directory to take advantage of page bundles.
  3. Push to Github.
  4. Github action takes over and does the rest.
    • See the "Deploying" section below for more information.
  5. s3deploy uploads the file to AWS.
  6. ???
  7. Profit. The website is now updated. Add CI/CD to your resume.

Hosting

The website is hosted in an AWS S3 bucket. CloudFront provides CDN and TLS (and certificate).

Deploying

I use a custom github action. See deploy.yml.

s3deploy

I use s3deploy to deploy the blog to AWS. The configuration is inside .s3deploy.yml. This example is suitable (with a bit of modification) for most static websites.

Static resources (fonts, images, css, etc.) do not have expiration dates. Everything else uses gzip compression. When a resource is updated, s3deploy invalidates its CloudFront cache.

Note: Enabling gzip compression for Keybase proofs (see static/keybase.txt) breaks them.

Use the s3deploy's example IAM policy. At the time of writing, AWS does not support addressing separate CloudFront distributions with ARNs (Amazon Resource Names) so the resulting key can list and invalidate all distributions.

Travis CI - Not Used Anymore

The blog used to use Travis CI. See @archive/.travis.yml.

  • The theme is a submodule. It's updated first.
  • Install two debs. Hugo and s3deploy. I like to control the versions as both software are under heavy development.
  • language:minimal reduces build time by 20 seconds (compared to the default container).
  • AWS key and secret are in AWS_ACCESS_KEY and AWS_SECRET_ACCESS_KEY environment variables respectively. These are used by s3deploy.

See @archive/deploy.bat for manual deployment.