省略镜像传输过程
This commit is contained in:
parent
ab3548837a
commit
39abb1974d
@ -21,27 +21,11 @@ jobs:
|
||||
docker build -t awesome-index:${{ github.sha }} .
|
||||
docker tag awesome-index:${{ github.sha }} awesome-index:latest
|
||||
|
||||
- name: Save Docker image
|
||||
run: |
|
||||
docker save awesome-index:latest | gzip > awesome-index.tar.gz
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: docker-image
|
||||
path: awesome-index.tar.gz
|
||||
retention-days: 1
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
if: github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: docker-image
|
||||
|
||||
- name: Deploy to server
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
@ -70,10 +54,6 @@ jobs:
|
||||
script: |
|
||||
cd /app/awesome
|
||||
|
||||
# 加载镜像
|
||||
gunzip -c awesome-index.tar.gz | docker load || true
|
||||
rm -f awesome-index.tar.gz
|
||||
|
||||
# 停止旧容器
|
||||
docker compose down --remove-orphans 2>/dev/null || true
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user