Giter Site home page Giter Site logo

viitoradmin / hugo-deploy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nathany/hugo-deploy

0.0 1.0 0.0 36 KB

Example deployment to S3 for Hugo blogs.

Home Page: http://hugo-deploy-example.s3-website.ca-central-1.amazonaws.com/

License: BSD 2-Clause "Simplified" License

Shell 1.54% HTML 79.99% Sass 18.47%

hugo-deploy's Introduction

Hugo Deploy

This is an starting point for a Hugo blog with deployment to Amazon S3 via GitHub Actions.

It's how I deploy nathany.com, Edmonton Go, and fsnotify.org.

Requirements

Local development:

  • Install the hugo binary, download it at gohugo.io.
    • On Mac use Homebrew: brew install hugo

Remote:

  • A GitHub account with the contents of your website (free).
  • An Amazon account to create an S3 bucket (pennies).
  • DNS configured to point to S3.

What Is Provided?

  • hugo new site <mysite> creates a config.toml and a few empty folders. I've added .gitkeep files so those folders are checked in.
  • An assets/sass folder with all.sass that will be converted to css.
  • A script to watch for file changes in development and include drafts in the output. Run ./watch.sh.
  • .gitignore to avoid committing the generated files.
  • Workflow file that GitHub Actions uses for deployment (.github/workflows/build.yml).

Deployment

GitHub Actions automatically deploy the website when changes are merged to the master branch on GitHub. In my experience, deploys take a few seconds to complete.

This bucket policy provides public access to the files in S3.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": [
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::hugo-deploy-example/*"
            ]
        }
    ]
}

hugo-deploy's People

Contributors

nathany avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.