Skip to content

Commit 643fbf9

Browse files
authored
Update cicd.yml (#36)
1 parent f68e962 commit 643fbf9

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

.github/workflows/cicd.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,50 @@ jobs:
4343
name: BackendApplicationJar
4444
path: backend/build/libs/*.jar
4545

46+
build-frontend:
47+
runs-on: ubuntu-22.04
48+
defaults:
49+
run:
50+
working-directory: frontend
51+
52+
steps:
53+
- name: Set up Repository
54+
uses: actions/checkout@v4
55+
56+
- name: Setup node with cache
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: 20
60+
cache: "npm"
61+
cache-dependency-path: "**/package-lock.json"
62+
63+
- name: Install dependencies
64+
run: npm install
65+
66+
- name: Build App
67+
run: npm run build
68+
69+
- name: Upload frontend build file to artifact
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: FrontendApplication
73+
path: frontend/out
74+
4675
deploy:
47-
needs: [build-backend]
76+
needs: [build-backend, build-frontend]
4877
runs-on: self-hosted
4978

5079
steps:
5180
- name: Remove previous version FRONT app
5281
working-directory: frontend/prod/
5382
run: rm -rf dist
5483

84+
- name: Download FRONT build file from artifact
85+
uses: actions/download-artifact@v4
86+
with:
87+
name: FrontendApplication
88+
path: frontend/prod/
89+
5590
- name: Remove previous version BACK jar
5691
working-directory: backend/prod/
5792
run: rm -f *.jar
@@ -61,3 +96,7 @@ jobs:
6196
with:
6297
name: BackendApplicationJar
6398
path: backend/prod/
99+
100+
- name: Deploy BACK to production server
101+
working-directory: backend/prod/
102+
run: ./start.sh

0 commit comments

Comments
 (0)