-
Notifications
You must be signed in to change notification settings - Fork 9
100 lines (92 loc) · 2.8 KB
/
node.js.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
check-skip:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Redundant Builds
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
build:
needs: check-skip
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: |
npm install --legacy-peer-deps --no-audit --no-fund --no-optional && npx -y ultra-runner --raw --recursive prepublishOnly &>/dev/null
npm run lint
npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/upload-artifact@v2
with:
name: public-folder
path: public
testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- name: Install xvfb for headless testing
run: sudo apt-get install xvfb
- name: Setup Max User Watches for Testing
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Testing
run: |
npm install --legacy-peer-deps --no-audit --no-fund --no-optional
npx -y ultra-runner --raw --recursive prepublishOnly &>/dev/null
xvfb-run --auto-servernum npm run test -- --ci
release:
needs: [build, testing]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: Release components
run: |
npm install --legacy-peer-deps --no-audit --no-fund --no-optional
npx @s-ui/ci release
env:
GITHUB_EMAIL: cloud-accounts@scmspain.com
GITHUB_TOKEN: ${{github.token}}
GITHUB_USER: sui-bot
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
deploy:
needs: [build, testing]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/download-artifact@v2
with:
name: public-folder
- name: Deploy
run: |
npm i -g vercel --no-save --no-fund --no-audit --no-optional --no-scripts
DEPLOYMENT_URL=$(vercel --token $VERCEL_TOKEN --confirm $VERCEL_PARAMS)
env:
VERCEL_PARAMS: ${{ github.event_name != 'pull_request' && '--prod' || ''}}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}