-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
053e739
commit 2bb6e48
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# This workflow will build a Java project with Maven | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
|
||
name: Java CI with Maven | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cache local Maven repository | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Cache local NPM | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Build with Maven | ||
run: mvn -B package -Pproduction --file pom.xml | ||
- name: Rename the war and remove the version | ||
run: mv ${{ secrets.DEMO_NAME }}/target/${{ secrets.DEMO_NAME }}*.war ${{ secrets.DEMO_NAME }}.war | ||
- name: SCP to the server | ||
# You may pin to the exact commit or the version. | ||
# uses: appleboy/scp-action@edc8ec9139a2687bcebf0249d0352ff2a988df00 | ||
uses: appleboy/[email protected] | ||
with: | ||
# scp remote host | ||
host: ${{ secrets.APP_FI_HOST }} | ||
# scp remote port | ||
port: ${{ secrets.APP_FI_PORT }} | ||
# scp username | ||
username: ${{ secrets.APP_FI_USER }} | ||
# scp password | ||
password: ${{ secrets.APP_FI_PASSWORD }} | ||
# target path on the server | ||
target: webapps/ | ||
# scp file list | ||
source: ${{ secrets.DEMO_NAME }}.war | ||
fingerprint: ${{ secrets.APP_FI_SHA256 }} |