-
Notifications
You must be signed in to change notification settings - Fork 5
241 lines (189 loc) · 5.99 KB
/
continuous-deployment.yaml
File metadata and controls
241 lines (189 loc) · 5.99 KB
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
name: Continuous Deployment
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout default branch
uses: actions/checkout@v6
- name: Use pnpm
uses: pnpm/action-setup@v5
with:
run_install: false
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install npm dependencies
run: pnpm i --frozen-lockfile
- name: Build the packages
run: pnpm build
- name: Cache the built artifacts
uses: actions/upload-artifact@v7
with:
name: built-artifacts
path: packages/*/dist
if-no-files-found: error
lint:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout default branch
uses: actions/checkout@v6
- name: Use pnpm
uses: pnpm/action-setup@v5
with:
run_install: false
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install npm dependencies
run: pnpm i --frozen-lockfile
- name: Download built artifacts
uses: actions/download-artifact@v8
with:
name: built-artifacts
path: packages
- name: Add app-bridge dependency for guideline-blocks-settings
run: pnpm add @frontify/app-bridge@workspace:^ --filter {packages/guideline-blocks-settings}
- name: Lint code
run: pnpm lint
typecheck:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout default branch
uses: actions/checkout@v6
- name: Use pnpm
uses: pnpm/action-setup@v5
with:
run_install: false
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install npm dependencies
run: pnpm i --frozen-lockfile
- name: Download built artifacts
uses: actions/download-artifact@v8
with:
name: built-artifacts
path: packages
- name: Add app-bridge dependency for guideline-blocks-settings
run: pnpm add @frontify/app-bridge@workspace:^ --filter {packages/guideline-blocks-settings}
- name: Typecheck code
run: pnpm typecheck
unit-tests:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
id-token: write
contents: write
pull-requests: write
steps:
- name: Checkout default branch
uses: actions/checkout@v6
- name: Use pnpm
uses: pnpm/action-setup@v5
with:
run_install: false
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install npm dependencies
run: pnpm i --frozen-lockfile
- name: Download built artifacts
uses: actions/download-artifact@v8
with:
name: built-artifacts
path: packages
- name: Add app-bridge dependency for guideline-blocks-settings
run: pnpm add @frontify/app-bridge@workspace:^ --filter {packages/guideline-blocks-settings}
- name: Test code
run: pnpm test
component-tests:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout current commit
uses: actions/checkout@v6
- name: Use pnpm
uses: pnpm/action-setup@v5
with:
run_install: false
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
- name: Get pnpm store directory
id: pnpm-cache
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v5
with:
path: |
${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
~/.cache/Cypress
key: pnpm-with-cypress-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: pnpm-with-cypress-${{ runner.os }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download built artifacts
uses: actions/download-artifact@v8
with:
name: built-artifacts
path: packages
- name: Add app-bridge dependency for guideline-blocks-settings
run: pnpm add @frontify/app-bridge@workspace:^ --filter {packages/guideline-blocks-settings}
- name: Component Tests
run: pnpm test:components
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [lint, typecheck, component-tests, unit-tests]
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
id-token: write # to authenticate with npm registry via OIDC
steps:
- name: Checkout default branch
uses: actions/checkout@v6
- name: Use pnpm
uses: pnpm/action-setup@v5
with:
run_install: false
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install npm dependencies
run: pnpm i --frozen-lockfile
- name: Create release PR or publish to npm
id: changesets
uses: changesets/action@v1
with:
commit: "chore: release packages"
title: "chore: release packages"
createGithubReleases: true
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true
# Use OIDC for npm authentication instead of NPM_TOKEN
NPM_TOKEN: "" # https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868