Skip to content

Commit

Permalink
update maven.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrationn committed Mar 14, 2024
1 parent 0af1894 commit 9ec77ea
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 15 deletions.
50 changes: 37 additions & 13 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,40 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Run SonarQube
run: mvn sonar:sonar -Dsonar.projectKey=ci-cd-test -Dsonar.host.url=${{ secrets.SONAR_HOST }} -Dsonar.login=${{ secrets.SONAR_TOKEN }}

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6

- name : upload file
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_IP }}
username: ${{ secrets.SSH_ID }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
source: "target/*.jar"
target: "~/"
rm: false

- name: execute shell script
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_IP }}
username: ${{ secrets.SSH_ID }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script_stop: true
script: "./startup.sh"
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<!--<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
</dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
Expand Down

0 comments on commit 9ec77ea

Please sign in to comment.