File tree 1 file changed +71
-7
lines changed
1 file changed +71
-7
lines changed Original file line number Diff line number Diff line change @@ -2,15 +2,9 @@ version: 2
2
2
3
3
jobs :
4
4
build :
5
- branches :
6
- ignore :
7
- - gh-pages
8
5
docker :
9
6
- image : circleci/node:10
10
7
working_directory : ~/repo
11
- environment :
12
- - SOURCE_BRANCH : master
13
- - TARGET_BRANCH : gh-pages
14
8
steps :
15
9
- checkout
16
10
- restore_cache :
24
18
key : v1-dependencies-{{ checksum "package.json" }}
25
19
- run : npm test
26
20
- run : npm run build
21
+ deploy :
22
+ docker :
23
+ - image : circleci/node:10
24
+ working_directory : ~/repo
25
+ environment :
26
+ - SOURCE_BRANCH : master
27
+ - TARGET_BRANCH : gh-pages
28
+ steps :
27
29
- deploy :
28
30
name : Deploy to Github Pages
29
31
command : |
46
48
git add -A
47
49
git commit -m "Deployed: website to Github Pages (automatic): ${CIRCLE_SHA1}" --allow-empty
48
50
git push -q https://${GH_TOKEN}@github.com/developersdo/opensource.git $TARGET_BRANCH
49
- fi
51
+ fi
52
+ scrape :
53
+ docker :
54
+ - image : circleci/node:10
55
+ working_directory : ~/repo
56
+ environment :
57
+ - SOURCE_BRANCH : master
58
+ - TARGET_BRANCH : gh-pages
59
+ steps :
60
+ - run :
61
+ name : Scraping Github data
62
+ command : |
63
+ if [ $CIRCLE_BRANCH == $SOURCE_BRANCH ]; then
64
+ git config --global user.email $GH_EMAIL
65
+ git config --global user.name $GH_NAME
66
+
67
+ npm run refresh
68
+
69
+ git add -A
70
+ git commit -m "Updated: Github data (automatic): ${CIRCLE_SHA1}" --allow-empty
71
+ git push -q https://${GH_TOKEN}@github.com/developersdo/opensource.git $SOURCE_BRANCH
72
+ fi
73
+
74
+ workflows :
75
+ version : 2
76
+ build_scrape_and_deploy_daily :
77
+ jobs :
78
+ - build
79
+ - scrape :
80
+ requires :
81
+ - build
82
+ - deploy :
83
+ requires :
84
+ - scrape
85
+ triggers :
86
+ - schedule :
87
+ cron : " 0 0 * * *"
88
+ filters :
89
+ branches :
90
+ only :
91
+ - master
92
+ build :
93
+ jobs :
94
+ - build :
95
+ filters :
96
+ branches :
97
+ ignore :
98
+ - gh-pages
99
+ - master
100
+ build_and_deploy :
101
+ jobs :
102
+ - build :
103
+ filters :
104
+ branches :
105
+ only :
106
+ - master
107
+ - deploy :
108
+ requires :
109
+ - build
110
+ filters :
111
+ branches :
112
+ only :
113
+ - master
You can’t perform that action at this time.
0 commit comments