-
-
Notifications
You must be signed in to change notification settings - Fork 80
114 lines (104 loc) · 3.26 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]'
strategy:
matrix:
node-version: [22.x, latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install -g npm@latest @angular/cli
npm clean-install
ng lint
ng test --watch false --browsers ChromeHeadless --code-coverage
ng build --configuration production --aot
env:
CI: true
- name: Codacy Coverage Reporter
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@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: latest
- name: Install Dependencies
run: npm install
- 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 }}
deploy:
needs: build
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js latest
uses: actions/setup-node@v4
with:
node-version: latest
- name: npm install, build, and test
run: |
npm install -g npm@latest @angular/cli
npm clean-install
ng build --configuration production --aot
env:
CI: true
- name: Checkout code on S3
uses: reggionick/s3-deploy@v4
with:
folder: dist/browser
bucket: ${{ secrets.AWS_S3_BUCKET }}
bucket-region: eu-central-1
dist-id: ${{ secrets.AWS_CLOUDFORNT_ID }}
delete-removed: true
no-cache: true
private: true
### UNCOMMENT THE FOLLOWING SECTION TO DEPLOY THE MASTER TO YOUR GITHUB USER PAGE ###
#
# deploy:
# needs: build
# runs-on: ubuntu-latest
#
# steps:
# - name: Download Build Artifact
# uses: actions/download-artifact@v4
# with:
# name: build_artifact
# path: dist
# - name: Deploy GitHub Page
# uses: JamesIves/github-pages-deploy-action@v4
# if: github.ref_name == 'master'
# with:
# # GitHub repository where assets will be deployed (default current)
# repository-name: StegSchreck/stegschreck.github.io
# # Git branch where assets will be deployed
# branch: master
# # delete files from your deployment destination that no longer exist in your deployment source
# clean: true
# # Build directory to deploy
# folder: dist/browser
# token: ${{ secrets.GHA_PAT }}