指定打包时的maven版本
Some checks failed
Build and Deploy Spring Boot / build-and-deploy (push) Failing after 36s
Some checks failed
Build and Deploy Spring Boot / build-and-deploy (push) Failing after 36s
This commit is contained in:
parent
467b0c1086
commit
fa09874fe0
@ -15,17 +15,16 @@ jobs:
|
||||
|
||||
# 设置JDK环境
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v3 # 使用最新的 v3 版本
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'temurin' # 或者使用 'adopt', 'zulu' 等其他发行版
|
||||
cache: 'maven' # 自动缓存 Maven 依赖
|
||||
maven-version: '3.8.6' # 指定 Maven 版本
|
||||
distribution: 'adopt'
|
||||
# 设置maven环境
|
||||
- name: Set up Maven
|
||||
uses: stCarolas/setup-maven@v4.5
|
||||
with:
|
||||
maven-version: '3.8.6'
|
||||
# 缓存Maven依赖
|
||||
# 缓存Maven依赖
|
||||
- name: Cache Maven packages
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
@ -37,13 +36,14 @@ jobs:
|
||||
- name: Build with Maven
|
||||
run: mvn clean package -DskipTests
|
||||
|
||||
# 将JAR包传输到服务器并部署
|
||||
- name: Deploy to Server
|
||||
# 使用 scp-action 传输文件
|
||||
- name: Copy JAR to Server
|
||||
uses: appleboy/scp-action@master
|
||||
with:
|
||||
host: ${{ secrets.SERVER_HOST }}
|
||||
username: ${{ secrets.SERVER_USERNAME }}
|
||||
password: ${{ secrets.SERVER_PASSWORD }}
|
||||
port: ${{ secrets.SERVER_PORT }}
|
||||
username: ${{ secrets.SERVER_USERNAME }}
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
source: "target/*.jar"
|
||||
target: "/home/tools/testActions"
|
||||
strip_components: 1
|
Loading…
x
Reference in New Issue
Block a user