This commit is contained in:
@@ -27,13 +27,8 @@ jobs:
|
||||
- name: 构建并推送镜像
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
# 使用项目中的 Dockerfile
|
||||
context: .
|
||||
|
||||
# 构建成功后自动将镜像推送到仓库
|
||||
push: true
|
||||
|
||||
# tags: 定义镜像的名称和标签
|
||||
tags: |
|
||||
registry.bmycode.help/app-product:latest
|
||||
registry.bmycode.help/app-product:${{ github.sha }}
|
||||
@@ -71,7 +66,5 @@ jobs:
|
||||
script: |
|
||||
# 拉取刚打包的最新镜像
|
||||
docker pull registry.bmycode.help/app-product:${{ github.sha }}
|
||||
# 进入部署目录
|
||||
cd /home/bmy/
|
||||
# 部署到 Swarm 集群
|
||||
docker stack deploy -c app-product.yml app-product
|
||||
docker stack deploy -c /home/bmy/app-product.yml app-product
|
||||
|
||||
Reference in New Issue
Block a user