File tree Expand file tree Collapse file tree 1 file changed +35
-39
lines changed
Expand file tree Collapse file tree 1 file changed +35
-39
lines changed Original file line number Diff line number Diff line change 11name : Build and Deploy WAR
22
33on :
4- push :
5- branches :
6- - master
7-
4+ push :
5+ tags :
6+ - ' v[0-9]+.[0-9]+ '
7+
88jobs :
99 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-
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v4
14+
15+ - name : Set up JDK 14
16+ uses : actions/setup-java@v4
17+ with :
18+ distribution : ' temurin'
19+ java-version : ' 21'
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 : Upload binaries to release
33+ uses : svenstaro/upload-release-action@v2
34+ with :
35+ repo_token : ${{ secrets.GITHUB_TOKEN }}
36+ file : helloworld.war
37+ asset_name : helloworld.war
38+ tag : ${{ github.ref }}
39+ overwrite : true
40+ body : " HAve fun :)"
You can’t perform that action at this time.
0 commit comments