Skip to content

Commit

Permalink
Add circleci to continuously deploy changes to squarespace
Browse files Browse the repository at this point in the history
As pull requests are merged to `master`, deploy them via circleci to the production squarespace
site.
  • Loading branch information
1egoman committed Sep 1, 2019
1 parent 9a4dbd6 commit a773b4c
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,24 @@ jobs:
- run:
name: "Push to squarespace"
command: |
# The '@' in the email needs to be url encoded, this is a quick way to accomplish that
SQUARESPACE_EMAIL="$(echo $SQUARESPACE_EMAIL | sed 's/@/%40/g')"
git push \
https://$SQUARESPACE_EMAIL:[email protected]/template.git \
master
# Define a helper to redact passwords from the output logs as the circleci deploy logs
# are public, after all!
function redact_password {
/bin/bash -c "$@" 2>&1 | sed "s/$SQUARESPACE_PASSWORD/<redacted>/g"
}
redact_password 'git remote add squarespace \
https://$SQUARESPACE_EMAIL:[email protected]/template.git'
# Pull any changes, if the resulting merge is complex bail and let a developer resolve
# it locally.
redact_password 'git fetch squarespace && git merge --ff-only squarespace/master'
# Deploy changes to squarespace
redact_password 'git push squarespace master'
workflows:
version: 2
Expand Down

0 comments on commit a773b4c

Please sign in to comment.