-
Notifications
You must be signed in to change notification settings - Fork 695
191 lines (166 loc) · 4.33 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
---
name: Deploy
run-name: Deploy to ${{ inputs.deploy-environment || 'Staging' }}
on:
workflow_dispatch:
inputs:
deploy-environment:
description: 'Which environment to deploy to'
required: true
type: choice
options:
- Staging
- Production
default: Staging
push:
branches:
- 'main'
- 'gha-deploy-*'
jobs:
queue:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: 'outdated_runs'
cancel_others: true
skip_after_successful_duplicate: true
paths_ignore: '["**/README.md", "**/docs/**"]'
do_not_skip: '["workflow_dispatch", "schedule"]'
verify:
runs-on: ubuntu-latest
steps:
- name: Cloning repository
uses: actions/checkout@v4
- name: Setting up Node.js
uses: actions/setup-node@v4
with:
node-version: 16
cache: npm
- name: Installing Node.js packages
run: npm ci
- name: Running tests
run: |
npx gulp updateTestResources
npx gulp lintNode
npx gulp lintYaml
npm run test:platform
npm run test:playground
prepare:
needs: verify
runs-on: ubuntu-latest
steps:
- name: Cloning repository
uses: actions/checkout@v4
- name: Setting up Node.js
uses: actions/setup-node@v4
with:
node-version: 16
cache: npm
- name: Installing Node.js packages
run: npm ci
- name: Preparing build
env:
APP_ENV: production
AMP_DOC_TOKEN: ${{ secrets.AMP_DOC_TOKEN }}
run: |
npx gulp buildPrepare
- name: Storing build artifacts
uses: actions/upload-artifact@v4
with:
name: build-setup
path: artifacts/setup.tar.gz
build:
env:
APP_ENV: production
needs: prepare
strategy:
matrix:
language:
[
'en',
'de',
'fr',
'ar',
'es',
'it',
'id',
'ja',
'ko',
'pt_BR',
'ru',
'tr',
'zh_CN',
'pl',
'vi',
]
runs-on: ubuntu-latest
steps:
- name: Cloning repository
uses: actions/checkout@v4
- name: Setting up Node.js
uses: actions/setup-node@v4
with:
node-version: 16
cache: npm
- name: Installing Node.js packages
run: npm ci
- name: Setting up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Installing Grow
run: |
sudo apt-get install libyaml-dev
pip install grow --upgrade-strategy eager
- name: Fetching build artifacts
uses: actions/download-artifact@v4
with:
name: build-setup
path: artifacts
- name: Unpacking artifacts
run: |
npx gulp unpackArtifacts
- name: Building pages
run: |
npx gulp buildPages --locales ${{ matrix.language }}
- name: Storing build artifacts
uses: actions/upload-artifact@v4
with:
name: pages-${{ github.run_id }}-${{ matrix.language }}
path: artifacts
deploy:
needs: build
runs-on: ubuntu-latest
environment: Production
env:
APP_ENV: production
NETLIFY_DEPLOY_TOKEN: ${{ secrets.NETLIFY_DEPLOY_TOKEN }}
steps:
- name: Cloning repository
uses: actions/checkout@v4
- name: Setting up Node.js
uses: actions/setup-node@v4
with:
node-version: 16
cache: npm
- name: Installing Node.js packages
run: npm ci
- name: Fetching build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Unpacking artifacts
run: |
npx gulp unpackArtifacts
- name: Finalizing build
run: |
npx gulp buildFinalize
- name: Deploying
env:
DEPLOY_ENVIRONMENT: ${{ inputs.deploy-environment || 'Staging' }}
run: |
npx gulp staticDeploy