-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add circleci to continuously deploy changes to squarespace
As pull requests are merged to `master`, deploy them via circleci to the production squarespace site.
- Loading branch information
Showing
1 changed file
with
17 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|