Skip to content

Instantly share code, notes, and snippets.

@nisevi
Last active January 24, 2024 04:27
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nisevi/42ca8a53ad376d7b5bba6f0dec9845ef to your computer and use it in GitHub Desktop.
Save nisevi/42ca8a53ad376d7b5bba6f0dec9845ef to your computer and use it in GitHub Desktop.
CircleCI 2.0 deploy to S3 static website - configuration file.
version: 2
jobs:
build:
working_directory: /tmp/vasko
docker:
- image: circleci/python:3.6.2-stretch-browsers
steps:
- checkout
- run:
name: Deploying Vasko.
command: echo Deploying Vasko.
- run:
name: Installing dependencies.
command: sudo pip install awscli
- deploy:
name: Deploy to S3 if branch is Master.
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
aws s3 sync /tmp/vasko/website s3://vaskohandmade/ --delete
fi
This is my file structure:
.gitignore
.circleci
|___config.yml
website
|___assets/
|___index.yml
|___favicon.ico
As you see the static site is inside the folder "website" that is why I do:
aws s3 sync /tmp/vasko/website s3://vaskohandmade/ --delete
while I specify my working directory as:
working_directory: /tmp/vasko
@ag0x00
Copy link

ag0x00 commented May 20, 2019

Thank you. This is the most common sense example I've seen.

@gabamnml
Copy link

You rocks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment