This project demonstrates how to continuously deploy a Jekyll site to S3 via CircleCI.
.circleci/config.yml
to the repo (see below for example)s3:GetObject
access (see below for example)AWS_ACCESS_KEY_ID
- from IAMAWS_SECRET_ACCESS_KEY
- from IAMAWS_REGION
- your default AWS regionAt this point, CircleCI should automatically build and deploy any changes you push to the master
branch.
version: 2.1
orbs:
ruby: circleci/[email protected]
s3: circleci/[email protected]
jobs:
build:
docker:
- image: circleci/ruby:2.6.5
steps:
- checkout
- run:
name: Install bundler
command: gem install bundler
- ruby/load-cache
- ruby/install-deps
- ruby/save-cache
- run:
name: Jekyll build
command: BUNDLE_PATH=vendor/bundle bundle exec jekyll build
- persist_to_workspace:
root: .
paths:
- _site
deploy:
docker:
- image: circleci/python:3.6
steps:
- attach_workspace:
at: .
- s3/sync:
from: _site
overwrite: true
to: 's3://YOUR_BUCKET_NAME_HERE/'
workflows:
continuous_deployment:
jobs:
- build
- deploy:
requires:
- build
{
"Version": "2012-10-17",
"Id": "s3BucketPolicy",
"Statement": [
{
"Sid": "allowPublicAccess",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR_BUCKET_NAME_HERE/*"
}
]
}