重新使用密码方式远程部署
Some checks are pending
Build and Deploy Spring Boot / build-and-deploy (push) Waiting to run

This commit is contained in:
hxuanyu 2024-11-04 16:48:41 +08:00
parent afcefe40a8
commit fa5166e7fc

View File

@ -15,7 +15,7 @@ jobs:
# 设置JDK环境
- name: Set up JDK 8
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
@ -24,7 +24,7 @@ jobs:
uses: stCarolas/setup-maven@v4.5
with:
maven-version: '3.8.6'
# 缓存Maven依赖
# 缓存Maven依赖
- name: Cache Maven packages
uses: actions/cache@v2
with:
@ -36,15 +36,13 @@ jobs:
- name: Build with Maven
run: mvn clean package -DskipTests
# 使用 scp-action 传输文件
- name: Copy JAR to Server
# 将JAR包传输到服务器并部署
- name: Deploy to Server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SERVER_HOST }}
port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
key_passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }}
password: ${{ secrets.SERVER_PASSWORD }}
port: ${{ secrets.SERVER_PORT }}
source: "target/*.jar"
target: "/home/tools/testActions"
strip_components: 1