-
-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (142 loc) ยท 4.79 KB
/
dev-commit-stage.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Commit Stage ๐ค
on:
push:
branches: [ feature/*, develop ]
pull_request:
branches: [ main, develop ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
VERSION: ${{ github.sha }}
CI: CI
NATIVE_IMAGE_ENABLED: enabled
CI_GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
permissions:
# required for all workflows
security-events: write
packages: write
contents: write
issues: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
validation:
name: Validation ๐
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check Project Integrity
uses: ./.github/actions/analysis/check
with:
tiptap-pro-token: ${{ secrets.TIPTAP_PRO_TOKEN }}
build:
name: Build and Test ๐งช
needs: [ validation ]
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: ๐ CI_GITHUB_TOKEN
if: env.CI_GITHUB_TOKEN == ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "CI_GITHUB_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Java Tools & Dependencies
uses: ./.github/actions/install/java
with:
java-version: 21
gradle-encription-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
gradle-arguments: build koverXmlReport --scan --no-daemon --stacktrace
github_token: ${{ env.CI_GITHUB_TOKEN }}
- name: Source code vulnerability scanning
uses: aquasecurity/[email protected]
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
category: source-code
- name: ๐ Upload coverage reports
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/reports/kover/report.xml
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
static-analysis-security:
name: ๐ฎ Static analysis and ๐Security Checks
needs: [ validation ]
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: ๐ Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Static Analysis Security
uses: ./.github/actions/analysis/security
with:
tiptap-pro-token: ${{ secrets.TIPTAP_PRO_TOKEN }}
gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
package-backend:
name: Package and Publish ๐ฆ
needs: [ build ]
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout source code
uses: actions/checkout@v4
- id: get_version
run: |
echo "version=$(cat gradle.properties | grep "version =" | cut -d'=' -f2 | sed 's/^ *//;s/ *$//')" >> $GITHUB_OUTPUT
- name: Build and Push Docker images for the backend application
uses: ./.github/actions/docker/backend
with:
deliver: false
docker_username: ${{ secrets.DOCKER_USERNAME }}
docker_password: ${{ secrets.DOCKER_PASSWORD }}
version: ${{ steps.get_version.outputs.version }}
ci_github_token: ${{ env.CI_GITHUB_TOKEN }}
gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
package-frontend:
name: Package and Publish ๐ฆ (Frontend application)
needs: [ build ]
runs-on: ubuntu-latest
permissions: write-all
strategy:
matrix:
target: [lyra-app,lyra-landing-page]
steps:
- name: Checkout source code
uses: actions/checkout@v4
- id: get_version
run: |
echo "version=$(cat gradle.properties | grep "version =" | cut -d'=' -f2 | sed 's/^ *//;s/ *$//')" >> $GITHUB_OUTPUT
- name: ๐๏ธ Build and Push Docker images for the frontend application ${{ matrix.target }}
uses: ./.github/actions/docker/frontend
with:
is_production: 'false'
docker_username: ${{ secrets.DOCKER_USERNAME }}
docker_password: ${{ secrets.DOCKER_PASSWORD }}
version: ${{ steps.get_version.outputs.version }}
ci_github_token: ${{ env.CI_GITHUB_TOKEN }}
target: ${{ matrix.target }}
tiptap_pro_token: ${{ secrets.TIPTAP_PRO_TOKEN }}