File tree Expand file tree Collapse file tree 1 file changed +24
-6
lines changed
Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Original file line number Diff line number Diff line change 11version : 2
22jobs :
33 build :
4+ ignore :
5+ - gh-pages
46 docker :
57 # specify the version you desire here
68 - image : circleci/node:10-browsers
7-
89 working_directory : ~/repo
9-
1010 steps :
1111 - checkout
1212
4646 docker :
4747 # specify the version you desire here
4848 - image : circleci/node:10-browsers
49-
5049 working_directory : ~/repo
51-
50+ environment :
51+ - SOURCE_BRANCH : master
52+ - TARGET_BRANCH : gh-pages
5253 steps :
5354 - add_ssh_keys :
5455 fingerprints :
8081 if [ "${CIRCLE_BRANCH}" == "master" ]; then
8182 git config user.name "CircleCI"
8283 git config user.email "circleci@users.noreply.github.com"
84+
85+ git clone $CIRCLE_REPOSITORY_URL out
86+
87+ cd out
88+ git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH
89+ git rm -rf .
90+ cd ..
91+
92+ npm run build
93+
94+ cp -a build/. out/.
95+
96+ mkdir -p out/.circleci && cp -a .circleci/. out/.circleci/.
97+ cd out
98+
8399 git add -A
84- git commit -m 'Deploy to GitHub pages [ci]'
85- git push
100+ git commit -m "Automated deployment to GitHub Pages: ${CIRCLE_SHA1}" --allow-empty
101+
102+ git push origin $TARGET_BRANCH
103+
86104 fi
87105workflows :
88106 version : 2
You can’t perform that action at this time.
0 commit comments