-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (50 loc) · 1.42 KB
/
pullrequest.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
name: Pull-Request CI
on:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Cache multiple paths
uses: actions/cache@v2
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json') }}
- name: Use Node.js 16
uses: actions/setup-node@v1
with:
node-version: 16.X
- run: npm install
- name: Build Libs
shell: bash
run: |
if [[ $GITHUB_BASE_REF ]]
then
export NX_BASE=remotes/origin/$GITHUB_BASE_REF
else
export NX_BASE=$(git rev-parse HEAD~1)
fi
echo "Base => $NX_BASE"
npm run affected:build -- --base=$NX_BASE
- name: Run Tests
shell: bash
run: |
if [[ $GITHUB_BASE_REF ]]
then
export NX_BASE=remotes/origin/$GITHUB_BASE_REF
else
export NX_BASE=$(git rev-parse HEAD~1)
fi
echo "Base => $NX_BASE"
npm run affected:test -- --base=$NX_BASE
- run: npm run build
- name: Deploy Preview
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist/apps/demo
destination_dir: ./pr_${{ github.event.number }}
keep_files: false