Skip to content

Commit 54faecc

Browse files
committed
ci(demo): add demo deployment script
1 parent c1bb868 commit 54faecc

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/main.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This workflow will build a Java project with Maven
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Java CI with Maven
5+
6+
on:
7+
push:
8+
branches: [ vaadin14 ]
9+
pull_request:
10+
branches: [ vaadin14 ]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Cache local Maven repository
18+
uses: actions/cache@v2
19+
with:
20+
path: ~/.m2/repository
21+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
22+
restore-keys: |
23+
${{ runner.os }}-maven-
24+
- name: Cache local NPM
25+
uses: actions/cache@v2
26+
with:
27+
path: ~/.npm
28+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
29+
restore-keys: |
30+
${{ runner.os }}-node-
31+
- uses: actions/checkout@v2
32+
- name: Set up JDK 1.8
33+
uses: actions/setup-java@v1
34+
with:
35+
java-version: 1.8
36+
- name: Build with Maven
37+
run: mvn -B clean install package -Pproduction --file pom.xml
38+
- name: Rename the war and remove the version
39+
run: mv ${{ secrets.DEMO_NAME }}/target/${{ secrets.DEMO_NAME }}*.war ${{ secrets.DEMO_NAME }}.war
40+
- name: SCP to the server
41+
# You may pin to the exact commit or the version.
42+
# uses: appleboy/scp-action@edc8ec9139a2687bcebf0249d0352ff2a988df00
43+
uses: appleboy/[email protected]
44+
with:
45+
# scp remote host
46+
host: ${{ secrets.APP_FI_HOST }}
47+
# scp remote port
48+
port: ${{ secrets.APP_FI_PORT }}
49+
# scp username
50+
username: ${{ secrets.APP_FI_USER }}
51+
# scp password
52+
password: ${{ secrets.APP_FI_PASSWORD }}
53+
# target path on the server
54+
target: webapps/
55+
# scp file list
56+
source: ${{ secrets.DEMO_NAME }}.war
57+
fingerprint: ${{ secrets.APP_FI_SHA256 }}

0 commit comments

Comments
 (0)