Created
December 11, 2021 16:23
-
-
Save biesnecker/ae7a5ddf093ee4a0d24f4a72deb27f1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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