-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (75 loc) · 2.11 KB
/
main.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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-
- run: |
npm -g install pnpm@5.18
pnpm set verify-store-integrity false
- run: pnpm install
- run: pnpm run test:coverage
- uses: codecov/codecov-action@v2
- run: mv "$(pnpm pack | tail -n 1)" pkg.tgz
- uses: actions/upload-artifact@v2
with:
name: package-art
path: pkg.tgz
test_example:
needs: test
runs-on: ubuntu-20.04
defaults:
run:
working-directory: example
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- uses: actions/download-artifact@v2
with:
name: package-art
path: example
- run: npm install pkg.tgz --only=development --no-package-lock
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-build-example-${{ hashFiles('**/example/package.json') }}
restore-keys: |
${{ runner.os }}-build-example-npm-
- run: npm install
- run: npm run build -- --prefix-paths
- if: github.event_name == 'push'
uses: actions/upload-artifact@v2
with:
name: example-art
path: example/public
deploy_example:
if: github.event_name == 'push'
needs: test_example
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v2
with:
name: example-art
path: public
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: public
force_orphan: true