Skip to content

Instantly share code, notes, and snippets.

@biesnecker
Created December 11, 2021 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biesnecker/ae7a5ddf093ee4a0d24f4a72deb27f1b to your computer and use it in GitHub Desktop.
Save biesnecker/ae7a5ddf093ee4a0d24f4a72deb27f1b to your computer and use it in GitHub Desktop.
version: 2.0
jobs:
build:
docker:
- image: cibuilds/hugo:latest
working_directory: ~/hugo
environment:
HUGO_BUILD_DIR: public/
steps:
- run:
name: Update apt
command: |
sudo apt-get update
sudo apt-get install -y git python3 python3-pip
- run:
name: Install awscli
command: pip3 install awscli
- checkout
- run:
name: Update git submodules
command: |
git submodule sync
git submodule update --init --recursive
- run:
name: Hugo build
command: HUGO_ENV=production hugo -v -d $HUGO_BUILD_DIR
- deploy:
name: Deploy to AWS
command: |
if [ "${CIRCLE_BRANCH}" = "main" ]; then
hugo deploy
else
echo "Not main branch, dry run only"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment