Skip to content

Commit

Permalink
fix(CI): add back missing ci demos deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincharity committed Nov 26, 2019
1 parent 74f6481 commit f4b91d3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
- *attach_workspace
- run:
name: Publish Demos
command: tooling/ci/promote-next-and-deploy.sh
command: tooling/ci/demos-deploy-ci.sh
generate_docs:
<<: *defaults
steps:
Expand Down
38 changes: 38 additions & 0 deletions tooling/ci/demos-deploy-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

#
# Deploy demos
#

. ~/.bashrc

# Clone the demo repo
cd "$HOME" || exit
# HACK: Avoid hosts unknown for GitHub: https://discuss.circleci.com/t/git-clone-fails-in-circle-2-0/15211
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
git clone git@github.com:GetTerminus/ui-demos-release.git

# Enter the demos repo
cd ui-demos-release || exit

# Remove old demo files
echo "Deleting old demo files:"
find . -regextype posix-extended -regex '.*\.(html|css|js)' -type f -delete

# Move new files into the cloned repo
mv -f -v "$HOME"/ci-build/dist/app/* "$HOME"/ui-demos-release/

# Clone the index.html file as 404.html to support deep linking
cp "$HOME"/ui-demos-release/index.html "$HOME"/ui-demos-release/404.html

# Update git credentials
git config credential.helper 'cache --timeout=120'
git config user.email "ben@benjamincharity.com"
git config user.name "benjamincharity"

# Commit new files
git add .
git commit -m "Update via CircleCI: release"

# Push quietly to prevent showing the token in log
git push -q https://"${GH_TOKEN}"@github.com/GetTerminus/ui-demos-release.git master

0 comments on commit f4b91d3

Please sign in to comment.