File tree Expand file tree Collapse file tree 1 file changed +29
-8
lines changed Expand file tree Collapse file tree 1 file changed +29
-8
lines changed Original file line number Diff line number Diff line change 1
1
version : 2
2
2
jobs :
3
3
build :
4
+ ignore :
5
+ - gh-pages
4
6
docker :
5
7
# specify the version you desire here
6
8
- image : circleci/node:10-browsers
7
-
8
9
working_directory : ~/repo
9
-
10
10
steps :
11
11
- checkout
12
12
@@ -46,10 +46,14 @@ jobs:
46
46
docker :
47
47
# specify the version you desire here
48
48
- image : circleci/node:10-browsers
49
-
50
49
working_directory : ~/repo
51
-
50
+ environment :
51
+ - SOURCE_BRANCH : master
52
+ - TARGET_BRANCH : gh-pages
52
53
steps :
54
+ - add_ssh_keys :
55
+ fingerprints :
56
+ - ' 3a:38:3d:25:c1:1e:d8:ec:69:a0:13:3c:c6:c9:24:a9'
53
57
- checkout
54
58
55
59
# Download and cache dependencies
@@ -75,11 +79,28 @@ jobs:
75
79
- deploy :
76
80
command : |
77
81
if [ "${CIRCLE_BRANCH}" == "master" ]; then
78
- git config user.name "CircleCI"
79
- git config user.email "[email protected] "
82
+ git config --global user.name "CircleCI"
83
+ git config --global user.email "[email protected] "
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:demo:github
93
+
94
+ cp -a docs/. out/.
95
+
96
+ mkdir -p out/.circleci && cp -a .circleci/. out/.circleci/.
97
+ cd out
98
+
80
99
git add -A
81
- git commit -m 'Deploy to GitHub pages [ci]'
82
- git push
100
+ git commit -m "Automated deployment to GitHub Pages: ${CIRCLE_SHA1}" --allow-empty
101
+
102
+ git push origin $TARGET_BRANCH
103
+
83
104
fi
84
105
workflows :
85
106
version : 2
You can’t perform that action at this time.
0 commit comments