-
-
Notifications
You must be signed in to change notification settings - Fork 82
95 lines (86 loc) · 2.75 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
94
95
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install -g npm@latest @angular/cli
npm ci --legacy-peer-deps
ng lint
ng test --watch false --browsers ChromeHeadless --code-coverage
ng build --configuration production --aot
env:
CI: true
- name: Codacy Coverage Reporter
if: github.actor != 'dependabot[bot]'
uses: codacy/codacy-coverage-reporter-action@v1.3.0
with:
api-token: ${{ secrets.CODACY_API_TOKEN }}
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
release:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: latest
- name: Install Dependencies
run: npm install --legacy-peer-deps
- name: Run Semantic Release
# for configuration of semantic-release, check the package.json and https://github.com/semantic-release/semantic-release/
run: npx semantic-release
env:
CI: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}
### UNCOMMENT THE FOLLOWING SECTION TO DEPLOY THE MASTER TO YOUR GITHUB USER PAGE ###
#
# deploy:
# needs: build
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Use Node.js 20.x
# uses: actions/setup-node@v3
# with:
# node-version: 20.x
# - name: Build
# run: |
# npm install -g npm@latest @angular/cli
# npm ci
# ng build --configuration production --aot
# env:
# CI: true
# - name: GitHub Pages Deploy
# uses: crazy-max/ghaction-github-pages@v1.2.5
# if: success() && github.ref == 'refs/heads/master'
# with:
# # GitHub repository where assets will be deployed (default current)
# repo: StegSchreck/stegschreck.github.io
# # Git branch where assets will be deployed
# target_branch: master
# # Create incremental commit instead of doing push force
# keep_history: true
# # Build directory to deploy
# build_dir: dist
# # Write the given domain name to the CNAME file
# #fqdn: stegschreck.github.io
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITHUB_PAT: ${{ secrets.GITHUB_PAT }}