Skip to content

Commit 1c73ffc

Browse files
Update maven.yml
test deploying front end
1 parent 39c233c commit 1c73ffc

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

.github/workflows/maven.yml

Lines changed: 33 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: ./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,14 @@ jobs:
3354
java-version: '17'
3455
distribution: 'temurin'
3556
cache: maven
57+
58+
- run: ls -R ./code/backend/src/main/resource/static/
59+
- name: download frontend
60+
uses: actions/download-artifact@v4
61+
with:
62+
name: frontend
63+
path: ./code/backend/src/main/resource/static/
64+
- run: ls -R ./code/backend/src/main/resource/static/
3665

3766
- name: Build with Maven
3867
run: mvn clean package --file pom.xml
@@ -45,7 +74,7 @@ jobs:
4574

4675
# build a docker image and push it to Docker Hub
4776
deploy:
48-
needs: [build]
77+
needs: [build-backend]
4978
runs-on: ubuntu-latest
5079

5180
steps:

0 commit comments

Comments
 (0)