1
1
version : 2.1
2
+
2
3
orbs :
4
+ pfe : pantheon-systems/front-end@dev:master
3
5
queue : eddiewebb/queue@1.5.0
6
+
7
+ workflows :
8
+ build-preview-test-deploy :
9
+ jobs :
10
+ - pfe/gatsby-build-and-deploy :
11
+ filters :
12
+ branches :
13
+ ignore : master
14
+ use-yarn : false
15
+ deployment-path : docs
16
+ incremental-build : true
17
+ gcp-bucket : " static.pantheonfrontend.website"
18
+ gatsby-cache-version : " v1.2"
19
+ pre-steps :
20
+ - checkout
21
+ - run :
22
+ name : Import Functions and Variables
23
+ command : .circleci/scripts/set-env.sh && source $BASH_ENV
24
+ - run :
25
+ name : Install PHP
26
+ command : sudo apt-get install -y php-cli php-xml
27
+ - run :
28
+ name : Install Terminus
29
+ command : |
30
+ php .circleci/scripts/terminus-installer.php
31
+ - run :
32
+ name : Import Tokens
33
+ command : gatsby-tokens
34
+ - run :
35
+ name : Import External Data
36
+ command : .circleci/scripts/import-external-data.sh
37
+ - persist_to_workspace :
38
+ root : .
39
+ paths :
40
+ - ./
41
+ - test-links :
42
+ requires :
43
+ - pfe/gatsby-build-and-deploy
44
+ - lighthouse :
45
+ requires :
46
+ - pfe/gatsby-build-and-deploy
47
+ filters :
48
+ branches :
49
+ ignore : master
50
+ - deploy :
51
+ requires :
52
+ - test-links
53
+ filters :
54
+ branches :
55
+ only : master
56
+
4
57
jobs :
5
- build :
58
+ test-links :
6
59
docker :
7
- - image : circleci/php:7.2-cli-node
60
+ - image : circleci/php:7.2-cli-node-browsers
8
61
environment :
9
- BUILD_PATH : /home/circleci/build
10
- working_directory : ~/build
62
+ BUILD_PATH : /home/circleci/project
63
+ working_directory : ~/project
11
64
steps :
65
+ - pfe/set-terminus-env
12
66
- checkout
13
67
- run :
14
68
name : Import Functions and Variables
15
69
command : .circleci/scripts/set-env.sh && source $BASH_ENV
16
- - restore_cache :
17
- keys :
18
- - v2.5.9-always-
19
- - restore_cache :
20
- keys :
21
- - npm-v2.8.4-
22
- - run :
23
- name : Install Terminus
24
- command : |
25
- php .circleci/scripts/terminus-installer.php
26
- - run :
27
- name : Install Gatsby
28
- command : |
29
- npm install -E
30
- - run :
31
- name : Import Gatsby Tokens
32
- command : gatsby-tokens
33
70
- run :
34
- name : Update external data files
35
- command : |
36
- bash .circleci/scripts/import-external-data.sh
37
- - run :
38
- name : Gatsby Build
39
- command : |
40
- npm run-script build
41
- - run :
42
- name : Remove empty directories
43
- command : |
44
- find ~/build/public -type d -empty -delete
71
+ name : Install Broken Link Checker
72
+ command : sudo npm install -g alexlouden/broken-link-checker
45
73
- run :
46
74
name : Check for merge conflicts
47
75
command : .circleci/scripts/merge_conflicts.sh
48
- - persist_to_workspace :
49
- root : .
50
- paths :
51
- - ./
52
-
53
- test :
54
- docker :
55
- - image : circleci/php:7.2-cli-node-browsers
56
- environment :
57
- BUILD_PATH : /home/circleci/build
58
- working_directory : ~/build
59
- steps :
60
- - attach_workspace :
61
- at : .
62
- - run :
63
- name : Import Functions and Variables
64
- command : .circleci/scripts/set-env.sh && source $BASH_ENV
65
- - run :
66
- name : Serve Gatsby
67
- command : |
68
- ./node_modules/gatsby/node_modules/.bin/gatsby serve --prefix-paths
69
- background : true
70
- - run :
71
- name : Wait...
72
- command : |
73
- dockerize -wait tcp://localhost:9000
74
76
- run :
75
77
name : Test links
76
- command : .circleci/tests/link-checker.sh
78
+ command : .circleci/tests/link-checker.sh "https://${TERMINUS_ENV}--${TERMINUS_SITE}.my.pantheonfrontend.website/docs"
77
79
- save_cache :
78
80
key : npm-v2.8.4-{{ checksum "package-lock.json" }}
79
81
paths :
80
82
- ~/build/node_modules
81
83
82
- preview :
83
- docker :
84
- - image : circleci/php:7.2-cli-node
85
- environment :
86
- BUILD_PATH : /home/circleci/build
87
- working_directory : ~/build
88
- steps :
89
- - attach_workspace :
90
- at : .
91
- - run :
92
- name : Import Functions and Variables
93
- command : .circleci/scripts/set-env.sh && source $BASH_ENV
94
- - run :
95
- name : Install rsync
96
- command : sudo apt-get update && sudo apt-get install -y rsync
97
- - run :
98
- name : Install Terminus
99
- command : php .circleci/scripts/terminus-installer.php
100
- - run :
101
- name : Deploy Multidev environment
102
- command : bash .circleci/scripts/deploy-multidev.sh
103
- no_output_timeout : 15m
104
- - store_artifacts :
105
- path : multidev-log.txt
106
- destination : multidev-log.txt
107
-
108
84
lighthouse :
109
85
docker :
110
86
- image : circleci/php:7.2-cli-node-browsers
111
87
environment :
112
- BUILD_PATH : /home/circleci/build
113
- working_directory : ~/build/
88
+ BUILD_PATH : /home/circleci/project
89
+ working_directory : ~/project
114
90
steps :
115
91
- attach_workspace :
116
92
at : .
93
+ - pfe/set-terminus-env
117
94
- run :
118
95
name : Import Functions and Variables
119
96
command : .circleci/scripts/set-env.sh && source $BASH_ENV
120
97
- run :
121
98
name : Lighthouse Audit
122
- command : .circleci/tests/lighthouse/run
99
+ command : npm ci && .circleci/tests/lighthouse/run
123
100
- store_artifacts :
124
101
path : lighthouse_data/
125
102
destination : lighthouse_data/
126
103
127
104
deploy :
128
105
docker :
129
- - image : circleci/php:7.2-cli-node
106
+ - image : circleci/php:7.2-cli
130
107
environment :
131
- BUILD_PATH : /home/circleci/build
132
- working_directory : ~/build
108
+ BUILD_PATH : /home/circleci/project
109
+ working_directory : ~/project
133
110
steps :
134
111
- queue/until_front_of_line :
135
112
time : ' 15'
@@ -152,45 +129,6 @@ jobs:
152
129
.circleci/scripts/deploy-live.sh
153
130
fi
154
131
no_output_timeout : 15m
155
- - save_cache :
156
- key : v2.5.9-always-{{ epoch }}
157
- paths :
158
- - ~/build/public
159
- - ~/build/.cache
160
132
- store_artifacts :
161
- path : deployment-log.txt
162
- destination : deployment-log.txt
163
-
164
- workflows :
165
- version : 2.1
166
- build-test-preview-and-deploy :
167
- jobs :
168
- - build
169
- - test :
170
- requires :
171
- - build
172
- - preview :
173
- filters :
174
- branches :
175
- ignore : master
176
- requires :
177
- - build
178
- - lighthouse :
179
- filters :
180
- branches :
181
- ignore : master
182
- requires :
183
- - preview
184
- - deploy :
185
- filters :
186
- branches :
187
- only : master
188
- requires :
189
- - test
190
-
191
- # Below is CircleCI 1.0 Config Syntax that is still supported on CircleCI 2.0
192
- experimental :
193
- notify :
194
- branches :
195
- only :
196
- - master
133
+ path : deployment-log.txt
134
+ destination : deployment-log.txt
0 commit comments