Add disk space cleanup step in CI workflow

Added a step to free up disk space before building the Docker image.
This commit is contained in:
ghmark675
2025-11-25 17:25:55 +08:00
committed by GitHub
parent ce9130c1d9
commit e417214523

View File

@@ -1,28 +1,33 @@
name: Docker Image CI
on:
push:
tags:
- 'v*'
jobs:
build_and_publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Free Disk Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
df -h
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
@@ -32,15 +37,12 @@ jobs:
type=ref,event=tag
type=semver,pattern={{version}}
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
- name: Build and push Docker image
uses: docker/build-push-action@v5
with: