-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (138 loc) · 3.93 KB
/
cicd.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
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
#name: Continuous Integration and Continuous Deployment Suivie Physique
#
#on:
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
# workflow_dispatch:
#
#jobs:
# build-test-deploy:
# name: Build & Test & Deploy Suivie Physique App
# runs-on: ubuntu-latest
# env:
# DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
#
# - name: Setup JDK 17
# uses: actions/setup-java@v3
# with:
# distribution: 'corretto'
# java-version: 17
#
# - name: Cache Maven packages
# uses: actions/cache@v2
# with:
# path: ~/.m2
# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
# restore-keys: ${{ runner.os }}-m2
#
# - name: Unit Test Backend
# run: mvn -B test --file backend/pom.xml
#
# - name: DeepSource Test Coverage
# uses: DeepSourceCorp/[email protected]
# with:
# dsn: DEEPSOURCE_DSN
#
# - name: Install DeepSource CLI
# run: |
# curl https://deepsource.io/cli | sh
#
# - name: Generate coverage report
# run: |
# touch ./coverage.out
# ./bin/deepsource report --analyzer test-coverage --key java --value-file ./coverage.out
#
# - name: Upload coverage report as artifact
# uses: actions/upload-artifact@v2
# with:
# name: coverage-report
# path: coverage.out
#
# - name: Download coverage report
# uses: actions/download-artifact@v2
# with:
# name: coverage-report
# path: .
#
# - name: Build Backend App
# run: |
# mvn clean
# mvn -B package --file backend/pom.xml
#
# - name: Setup Node.js environment
# uses: actions/setup-node@v4
# with:
# node-version: '16'
#
# - name: Cache Node Modules
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules
# with:
# path: frontend/node_modules
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-${{ runner.os }}-build-${{ runner.os }}
#
# - name: Install Dependencies
# run: |
# npm install --prefix frontend
# npm install --prefix frontend tailwindcss postcss autoprefixer
#
## - name: Running Frontend Tests
## run: npm run test:ci --prefix frontend
#
# - name: Building Frontend App
# run: npm run build:ci --prefix frontend
#
# - name: Packaging App
# run: mvn clean package
#
# - name: Setup Docker Buildx
# uses: docker/setup-buildx-action@v3
#
#
# - name: Build to Dockerhub
# run: docker-compose build
#
# - name: Show Built images
# run: |
# docker images backend
# docker images frontend
#
# - name: Tag to Dockerhub
# run: |
# docker tag backend dotcipher1/sp-backend:latest
# docker tag frontend dotcipher1/sp-frontend:latest
#
# - name: Login to Dockerhub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
#
# - name: Docker Scout
# uses: docker/scout-action@v1
# with:
# command: cves,recommendations,quickview
# to-latest: true
# ignore-base: true
# ignore-unchanged: true
# only-fixed: true
#
# - name: Push to Dockerhub
# run: |
# docker push dotcipher1/sp-backend:latest
# docker push dotcipher1/sp-frontend:latest
#
# # - name: Push to Dockerhub
# # uses: docker/[email protected]
# # with:
# # push: true
# # tags: "dotcipher/sp-backend:latest ,dotcipher/sp-frontend:latest"
# # github-token: ${{ secrets.GITHUB_TOKEN }}