fix(ci): Fix build docker image error (#2279)

This commit is contained in:
Fangyin Cheng 2025-01-06 17:43:50 +08:00 committed by GitHub
parent 295cdb8723
commit 214105abee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View File

@ -6,11 +6,11 @@ on:
- main
paths:
- 'docs/**'
- '.github/workflows/docker-image-publish.yml'
- '.github/workflows/doc-image-publish.yml'
pull_request:
paths:
- 'docs/**'
- '.github/workflows/docker-image-publish.yml'
- '.github/workflows/doc-image-publish.yml'
release:
types: [published]
workflow_dispatch:

View File

@ -21,7 +21,10 @@ jobs:
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
docker rmi $(docker image ls -aq)
# Only delete Docker images when they exist
if [ ! -z "$(docker image ls -aq)" ]; then
docker rmi $(docker image ls -aq)
fi
df -h
- name: Set up QEMU
uses: docker/setup-qemu-action@v2