Skip to content

Commit 026f830

Browse files
committed
Merge branch 'testGitHub-Action' of https://github.com/BUMETCS673/seprojects-cs673f24a2team2 into testGitHub-Action
2 parents 66651f1 + 9c1a43a commit 026f830

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

.github/workflows/maven.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# documentation.
88

99
# Action name
10-
name: Java CI with Maven
10+
name: Test Java CI with Maven
1111

1212
# When will the action run
1313
on:
@@ -17,9 +17,30 @@ on:
1717
branches: [ "testGitHub-Action" ]
1818

1919
jobs:
20-
# build the project
21-
build:
20+
build-frontend:
21+
runs-on: ubuntu-latest
22+
defaults:
23+
run:
24+
working-directory: ./code/frontend
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Set up npm
30+
uses: actions/setup-node@v4
2231

32+
- run: npm install
33+
- run: npm run build
34+
35+
- name: Upload artifact
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: frontend
39+
path: ./code/frontend/dist/
40+
41+
# build the project
42+
build-backend:
43+
needs: [build-frontend]
2344
runs-on: ubuntu-latest
2445
defaults:
2546
run:
@@ -33,6 +54,12 @@ jobs:
3354
java-version: '17'
3455
distribution: 'temurin'
3556
cache: maven
57+
58+
- name: download frontend
59+
uses: actions/download-artifact@v4
60+
with:
61+
name: frontend
62+
path: ./code/backend/src/main/resource/static/
3663

3764
- name: Build with Maven
3865
run: mvn clean package --file pom.xml
@@ -45,7 +72,7 @@ jobs:
4572

4673
# build a docker image and push it to Docker Hub
4774
deploy:
48-
needs: [build]
75+
needs: [build-backend]
4976
runs-on: ubuntu-latest
5077

5178
steps:

0 commit comments

Comments
 (0)