Skip to content

Commit 1aaa62b

Browse files
authored
ci: update war file automatically
* Create main.yml * Update main.yml
1 parent 22d137e commit 1aaa62b

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Deploy WAR
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up JDK 14
17+
uses: actions/setup=java@v1
18+
with:
19+
java-version: 14
20+
21+
- name: Build WAR
22+
run: jar cvf helloworld.war WEB-INF
23+
24+
- name: Display WAR file
25+
run: ls helloworld.war
26+
27+
- name: Deploy WAR
28+
run: |
29+
mkdir -p deployment
30+
cp helloworld.war deployment/
31+
32+
- name: Store WAR files in repo
33+
run: |
34+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
35+
git config --global user.name "github-actions[bot]"
36+
mkdir -p war
37+
cp helloworld.war war/
38+
git add war
39+
git commit -m "Add WAR file"
40+
git push origin master
41+
42+
43+
44+

0 commit comments

Comments
 (0)