-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (66 loc) · 2.59 KB
/
build.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
name: Build Rangee
run-name: 🏗️ ${{ github.event.head_commit.message }}
on:
workflow_call:
push:
branches:
- '*'
tags-ignore:
- '*'
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install node and yarn
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- name: Install deps
run: yarn install --frozen-lockfile
- name: Run lint
run: yarn lint
- name: Run build
run: yarn build
- name: Run unit tests
run: yarn test:unit:ci
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: yarn test:e2e
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
DeployExample:
needs: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Go to example directory
run: cd examples/nextjs
- name: Install node and yarn
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel environment information
run: vercel pull --yes --cwd ./examples/nextjs --scope=${{ secrets.VERCEL_TEAM_ID }} --token=${{ secrets.VERCEL_TOKEN }}
- name: Build project artifacts
run: vercel build --cwd ./examples/nextjs --scope=${{ secrets.VERCEL_TEAM_ID }} --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy
run: |
vercel deploy --cwd ./examples/nextjs --prebuilt --token=${{ secrets.VERCEL_TOKEN }} > domain.txt
vercel alias --cwd ./examples/nextjs --scope=${{ secrets.VERCEL_TEAM_ID }} --token=${{ secrets.VERCEL_TOKEN }} set `cat domain.txt` rangee-example.vercel.app