-
Notifications
You must be signed in to change notification settings - Fork 20
126 lines (99 loc) · 4.13 KB
/
cd.yml
File metadata and controls
126 lines (99 loc) · 4.13 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
name: Continuous Delivery
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
continuous-integration:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install pnpm package manager
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Set up Node.js version
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: .nvmrc
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: "Continuous Integration: lint"
run: pnpm run --if-present lint
- name: "Continuous Integration: build"
run: pnpm run --if-present build
- name: "Continuous Integration: test"
run: pnpm run --if-present test
- name: "Retain build artifact: website"
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
include-hidden-files: true
name: website
path: build/
retention-days: 1
e2e-test:
runs-on: ubuntu-latest
needs: [continuous-integration]
steps:
- name: Checkout branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install pnpm package manager
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Set up Node.js version
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: .nvmrc
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: "Install headless browsers for end-to-end testing"
run: pnpm run --if-present install-test-browsers
- name: "Restore build artifact: website"
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: website
path: build/
- name: "Continuous Integration: end-to-end tests"
run: pnpm run --if-present test-e2e
- name: "Continuous Integration: make screenshots"
if: ${{ github.ref_name == 'main' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'visual regression test')) }}
run: pnpm run --if-present test-visual
- name: "Continuous Integration: publish screenshots to Argos"
if: ${{ github.ref_name == 'main' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'visual regression test')) }}
env:
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
run: pnpm run --if-present publish:argos
- name: "Retain build artifact: test report"
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: playwright-report
path: tmp/playwright-html-report/
retention-days: 7
- name: "Retain build artifact: screenshots"
if: ${{ github.ref_name == 'main' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'visual regression test')) }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: screenshots
path: tmp/screenshots/
retention-days: 7
publish-website:
runs-on: ubuntu-latest
needs: continuous-integration
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout release branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: "Restore build artifact: website"
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: website
path: build/
- name: Continuous Deployment to GitHub Pages
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3
with:
branch: gh-pages
folder: build/