-
Notifications
You must be signed in to change notification settings - Fork 4
47 lines (43 loc) · 1.62 KB
/
develop.yml
File metadata and controls
47 lines (43 loc) · 1.62 KB
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
# 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: [ develop ]
pull_request:
branches: [ develop ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 19
- name: Checkstyle with Maven
run: mvn -B validate compile --file pom.xml
# - name: Build the docker-compose stack
# run: docker-compose up -d
- name: Test with Maven
run: mvn -B jacoco:prepare-agent install jacoco:report -Pprod --file pom.xml
- name: Copy Artifacts
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
# port: ${{ secrets.PORT }}
key: ${{ secrets.KEY }}
source: "gurukulams-web/target/*.jar"
target: ${{ secrets.TARGET_DIR }}
strip_components: 2
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
target: ${{ secrets.TARGET_DIR }}
script:
echo "cd ${{ secrets.TARGET_DIR }} && kill $(ps -ef | grep java | grep -v grep | awk '{print $2}') || true && nohup ${{ secrets.SOFTWARES_DIR }}/jre/bin/java -jar gurukulams-web-*.jar >/dev/null 2>&1 &" > deploy.sh && sh deploy.sh &