ci: update war file automatically #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy WAR | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK 14 | |
uses: actions/setup=java@v1 | |
with: | |
java-version: 14 | |
- name: Build WAR | |
run: jar cvf helloworld.war WEB-INF | |
- name: Display WAR file | |
run: ls helloworld.war | |
- name: Deploy WAR | |
run: | | |
mkdir -p deployment | |
cp helloworld.war deployment/ | |
- name: Store WAR files in repo | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
mkdir -p war | |
cp helloworld.war war/ | |
git add war | |
git commit -m "Add WAR file" | |
git push origin master | |