-
Notifications
You must be signed in to change notification settings - Fork 7
58 lines (53 loc) · 1.82 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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: [ main ]
pull_request:
branches: [ main ]
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 11
uses: actions/setup-java@v1
with:
java-version: '11'
- 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_JAVA11 }}
# scp remote port
port: ${{ secrets.APP_FI_PORT_JAVA11 }}
# scp username
username: ${{ secrets.APP_FI_USER_JAVA11 }}
# scp password
password: ${{ secrets.APP_FI_PASSWORD_JAVA11 }}
# target path on the server
target: webapps/
# scp file list
source: ${{ secrets.DEMO_NAME }}.war
fingerprint: ${{ secrets.APP_FI_SHA256_JAVA11 }}