Skip to content

Commit 878f074

Browse files
committed
test: action
1 parent dd1d466 commit 878f074

2 files changed

Lines changed: 48 additions & 6 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3+
4+
name: Maven Package run
5+
6+
on:
7+
workflow_dispatch:
8+
9+
push:
10+
branches: [ refine ]
11+
pull_request:
12+
branches: [ refine ]
13+
14+
jobs:
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Set up JDK 17
25+
uses: actions/setup-java@v3
26+
with:
27+
java-version: '17'
28+
distribution: 'temurin'
29+
server-id: github
30+
settings-path: ${{ github.workspace }}
31+
32+
- name: Generate the package
33+
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
34+
35+
- name: 删除旧的jar包以及运行脚本
36+
run: sshpass -p ${{ secrets.PASSWORD }} ssh -o StrictHostKeyChecking=no ${{ secrets.USERIP }} "cd /root && rm -f system-1.0-SNAPSHOT.jar && rm -f run.sh"
37+
38+
- name: 上传jar包和启动脚本到服务器中
39+
run: sshpass -p ${{ secrets.PASSWORD }} scp -r -o StrictHostKeyChecking=no /home/runner/work/bilibili-to-netease-cloud-music/bilibili-to-netease-cloud-music/system/target/system-1.0-SNAPSHOT.jar ./run.sh ${{ secrets.USERIP }}:/root
40+
41+
- name: 启动项目
42+
run: sshpass -p ${{ secrets.PASSWORD }} ssh -o StrictHostKeyChecking=no ${{ secrets.USERIP }} "cd /root && chmod +x run.sh && ./run.sh"

system/src/main/resources/application.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ server:
1313
port: 25565
1414
spring:
1515
datasource:
16-
url: jdbc:mysql://127.0.0.1:3306/netmusic4?serverTimezone=Asia/Shanghai
16+
url: #jdbc:mysql://127.0.0.1:3306/netmusic4?serverTimezone=Asia/Shanghai
1717
driver-class-name: com.mysql.cj.jdbc.Driver
18-
username: 用户名
19-
password: 密码
18+
username: #用户名
19+
password: #密码
2020
hikari:
2121
max-lifetime: 100000
2222

@@ -26,9 +26,9 @@ spring:
2626
max-request-size: 100000000
2727
data:
2828
redis:
29-
host:
30-
port:
31-
password:
29+
host: #地址
30+
port: #端口
31+
password: #密码
3232

3333
mybatis-plus:
3434
global-config:

0 commit comments

Comments
 (0)