Skip to content

Commit

Permalink
fix PR deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
redallen committed Feb 14, 2019
1 parent 8565ff6 commit eee9896
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions .circleci/upload_preview.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash
# Split on "/", ref: http://stackoverflow.com/a/5257398/689223
REPO_SLUG_ARRAY=(${CIRCLE_PROJECT_REPONAME//\// })
REPO_OWNER=${REPO_SLUG_ARRAY[0]}
REPO_NAME=${REPO_SLUG_ARRAY[1]}
DEPLOY_PATH=./.public
REPO_OWNER=$CIRCLE_PROJECT_USERNAME
REPO_NAME=$CIRCLE_PROJECT_REPONAME
DEPLOY_PATH=.public

DEPLOY_SUBDOMAIN_UNFORMATTED_LIST=()
if [ ! -z $CIRCLE_PR_NUMBER ]
if [ ! -z $CIRCLE_PULL_REQUEST ]
then
DEPLOY_SUBDOMAIN_UNFORMATTED_LIST+=($CIRCLE_PR_NUMBER-pr)
# Split on "/", ref: http://stackoverflow.com/a/5257398/689223
URL_SPLIT=(${CIRCLE_PULL_REQUEST//\// })
PR_NUM=$(printf %s\\n "${URL_SPLIT[@]:(-1)}")
DEPLOY_SUBDOMAIN_UNFORMATTED_LIST+=($PR_NUM-pr)
fi

if [ -n "${CIRCLE_TAG// }" ] #TAG is not empty
Expand Down Expand Up @@ -45,7 +46,7 @@ do

yarn run surge --project ${DEPLOY_PATH} --domain $DEPLOY_DOMAIN;

if [ -z "${ALREADY_DEPLOYED// }" ] && [ -z $CIRCLE_PR_NUMBER ]
if [ -z "${ALREADY_DEPLOYED// }" ] && [ -z $CIRCLE_PULL_REQUEST ]
then
echo 'Adding github PR comment'
# Using the Issues api instead of the PR api
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
"stylelint": "^9.10.1",
"stylelint-config-standard": "^18.2.0",
"surge": "^0.20.1",
"terser": "3.14.1",
"ts-jest": "^23.10.5"
},
"optionalDependencies": {
Expand Down Expand Up @@ -190,6 +189,7 @@
]
},
"resolutions": {
"cssom": "0.3.4"
"cssom": "0.3.4",
"terser": "3.14.1"
}
}

0 comments on commit eee9896

Please sign in to comment.