This commit is contained in:
@@ -61,6 +61,13 @@ jobs:
|
|||||||
script: |
|
script: |
|
||||||
# 拉取刚打包的最新镜像
|
# 拉取刚打包的最新镜像
|
||||||
docker pull registry.bmycode.help/app-product:${{ github.sha }}
|
docker pull registry.bmycode.help/app-product:${{ github.sha }}
|
||||||
|
echo '清理旧的 镜像...'
|
||||||
|
# 删除除了本次 github.sha 和 latest 之外的所有 镜像
|
||||||
|
docker images registry.bmycode.help/app-product --format 'table {{.Repository}}:{{.Tag}}' | \
|
||||||
|
grep -v 'registry.bmycode.help/app-product:${{ github.sha }}' | \
|
||||||
|
grep 'registry.bmycode.help/app-product' | \
|
||||||
|
xargs -r docker rmi -f || true
|
||||||
|
|
||||||
|
|
||||||
- name: 管理节点部署到 Swarm
|
- name: 管理节点部署到 Swarm
|
||||||
uses: appleboy/ssh-action@v1
|
uses: appleboy/ssh-action@v1
|
||||||
|
|||||||
Reference in New Issue
Block a user