-
Notifications
You must be signed in to change notification settings - Fork 1.9k
84 lines (82 loc) · 2.26 KB
/
website.yml
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
name: Website
on:
pull_request:
branches: [master]
paths:
- '.github/workflows/website.yml'
- 'docs/**'
- 'website/**'
push:
branches: [master]
paths:
- '.github/workflows/website.yml'
- 'docs/**'
- 'website/**'
jobs:
checks:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
website:
- 'website/**'
- name: Test Build
working-directory: ./website
run: |
npm i
npm run build
- name: Run Percy Snapshot
working-directory: ./website
if: steps.changes.outputs.website == 'true'
run: npm run percy
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
gh-release:
if: github.event_name != 'pull_request'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
- name: Release to GitHub Pages
env:
USE_SSH: true
GIT_USER: git
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "mobilewix"
cd website/
npm i
npm run build
npm run percy
npx docusaurus deploy
performance:
needs: gh-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: mkdir -p ${{ github.workspace }}/tmp/artifacts
- name: Lighthouse
uses: foo-software/lighthouse-check-action@master
with:
urls: 'https://wix.github.io/Detox/,https://wix.github.io/Detox/docs/next/demo/'
outputDirectory: ${{ github.workspace }}/tmp/artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Lighthouse reports
path: ${{ github.workspace }}/tmp/artifacts