Skip to content

Commit 54e505a

Browse files
committed
fix: 修正 Native Image 构建命令及服务器部署路径
- Dockerfile: compile-no-fork 改为 native:compile,确保 Java 编译阶段被触发(否则找不到 main class) - workflow: 部署目标路径改为 /home/ubuntu/involution-hell,与服务器实际目录一致
1 parent e03b38c commit 54e505a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
username: ${{ secrets.SERVER_USER }}
6161
key: ${{ secrets.SERVER_SSH_KEY }}
6262
source: "docker-compose.yml,Caddyfile,docker/"
63-
target: "/opt/involutionhell"
63+
target: "/home/ubuntu/involution-hell"
6464

6565
- name: 远程执行部署
6666
uses: appleboy/ssh-action@v1
@@ -69,7 +69,7 @@ jobs:
6969
username: ${{ secrets.SERVER_USER }}
7070
key: ${{ secrets.SERVER_SSH_KEY }}
7171
script: |
72-
cd /opt/involutionhell
72+
cd /home/ubuntu/involution-hell
7373
7474
# 写入镜像名,确保拉取最新
7575
export BACKEND_IMAGE_NAME=${{ env.IMAGE_NAME }}:${{ github.sha }}

‎Dockerfile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ RUN chmod +x mvnw && ./mvnw dependency:go-offline -q
1111

1212
# 复制源码并编译 Native Image
1313
COPY src ./src
14-
RUN ./mvnw -DskipTests native:compile-no-fork -q
14+
# native:compile 会自动触发 Java 编译阶段并识别 Spring Boot 主类
15+
RUN ./mvnw -DskipTests native:compile -q
1516

1617
# 第二阶段:最小化运行镜像
1718
FROM ubuntu:24.04

0 commit comments

Comments
 (0)