Skip to content

Commit 0c76b0a

Browse files
committed
chore(deploy):优化部署流程文件准备步骤
- 新增文件准备步骤,创建 upload 目录统一管理待上传文件 - 复制 entrance JAR 包、生产环境配置文件和重启脚本至 upload 目录 Signed-off-by: LiggMax <wenzhouli06@gmail.com>
1 parent 040b5df commit 0c76b0a

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ jobs:
2525
- name: Build with Maven
2626
run: mvn clean package
2727

28+
# 创建待上传文件夹并复制文件
29+
- name: Prepare files for upload
30+
run: |
31+
mkdir -p upload
32+
cp entrance/target/entrance*.jar upload/
33+
cp entrance/src/main/resources/application-prod.yaml upload/
34+
cp restart.sh upload/
35+
2836
# 上传文件到服务器
2937
- name: Upload file via SSH
3038
uses: appleboy/scp-action@v1
@@ -33,7 +41,7 @@ jobs:
3341
username: ${{ secrets.SERVER_USER }}
3442
port: ${{ secrets.SERVER_PORT }}
3543
key: ${{ secrets.SERVER_SSH_KEY }}
36-
source: "entrance/target/entrance*.jar,entrance/src/main/resources/application-prod.yaml,restart.sh"
44+
source: "upload/*"
3745
target: ${{ secrets.SERVER_PROJECT_PATH }}
3846

3947
# 执行 restart.sh
@@ -44,7 +52,7 @@ jobs:
4452
username: ${{ secrets.SERVER_USER }}
4553
port: ${{ secrets.SERVER_PORT }}
4654
key: ${{ secrets.SERVER_SSH_KEY }}
47-
script: |
55+
script: |
4856
cd ${{ secrets.SERVER_PROJECT_PATH }}
4957
chmod 755 restart.sh
5058
# 获取最新 jar 文件名

0 commit comments

Comments
 (0)