-
Notifications
You must be signed in to change notification settings - Fork 8
93 lines (88 loc) · 2.47 KB
/
ci.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
name: Trevas JS CI
on: [push]
jobs:
test-build:
name: Test & build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn
# Build modules
- run: yarn build
# Build sonar reports
- run: yarn test --coverage
- name: Upload deploy artifact
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage/
sonarcloud:
runs-on: ubuntu-latest
needs: test-build
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download coverage artifact
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
build-assets:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: sonarcloud
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn
# Build modules
- run: yarn build
# Build Storybook
- run: yarn build-storybook
- run: mkdir -p deploy/storybook
- run: cp -R ./built-storybook/storybook/. ./deploy/storybook
# Build bundle reports
- run: yarn analyze
- run: mkdir -p deploy/bundle-report
- run: cp -a ./packages/vtl-2.0-antlr-tools/bundle-report/. ./deploy/bundle-report
- run: cp -a ./packages/trevas/bundle-report/. ./deploy/bundle-report
- uses: actions/setup-node@v3
with:
# Because of gitbook support
node-version: 10
- run: |
npm i -g gitbook-cli
gitbook install
gitbook build
working-directory: ./docs/
- run: cp -a ./docs/_book/. ./deploy/
- name: Upload deploy artifact
uses: actions/upload-artifact@v3
with:
name: deploy
path: deploy/
deploy:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: build-assets
steps:
- name: Download deploy artifact
uses: actions/download-artifact@v3
with:
name: deploy
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .