重新使用密码方式远程部署
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环境 # 设置JDK环境
- name: Set up JDK 8 - name: Set up JDK 8
uses: actions/setup-java@v2 uses: actions/setup-java@v3
with: with:
java-version: '8' java-version: '8'
distribution: 'adopt' distribution: 'adopt'
@ -36,15 +36,13 @@ jobs:
- name: Build with Maven - name: Build with Maven
run: mvn clean package -DskipTests run: mvn clean package -DskipTests
# 使用 scp-action 传输文件 # 将JAR包传输到服务器并部署
- name: Copy JAR to Server - name: Deploy to Server
uses: appleboy/scp-action@master uses: appleboy/scp-action@master
with: with:
host: ${{ secrets.SERVER_HOST }} host: ${{ secrets.SERVER_HOST }}
port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.SERVER_USERNAME }} username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }} password: ${{ secrets.SERVER_PASSWORD }}
key_passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }} port: ${{ secrets.SERVER_PORT }}
source: "target/*.jar" source: "target/*.jar"
target: "/home/tools/testActions" target: "/home/tools/testActions"
strip_components: 1