Last active
January 24, 2024 04:27
-
-
Save nisevi/42ca8a53ad376d7b5bba6f0dec9845ef to your computer and use it in GitHub Desktop.
CircleCI 2.0 deploy to S3 static website - configuration file.
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 | |
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 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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you. This is the most common sense example I've seen.