-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.39 KB
/
ci.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
name: CI
on:
push:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Before install
run: npm set //npm.pkg.github.com/:_authToken ${{secrets.TOKEN_FOR_WORKFLOWS}}
- name: Install dependencies
run: npm ci
- name: Unit tests
run: npm run test -- --watch=false --no-progress --browsers=ChromeHeadless --code-coverage
- name: Sonar Cloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{secrets.TOKEN_FOR_WORKFLOWS}}
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
- name: E2E tests
run: ./build-scripts/conditional-e2e.sh
shell: bash
- name: Build for deployment
run: npm run build -- --configuration=testdeployment --baseHref="https://sitmun.github.io/admin-app/"
- name: Deploy to GitHub pages
env:
USERNAME: ${{secrets.USERNAME_FOR_WORKFLOWS}}
GITHUB_API_KEY: ${{secrets.TOKEN_FOR_WORKFLOWS}}
run: ./build-scripts/deploy.sh
shell: bash