Skip to content

Commit 523984b

Browse files
committed
clean up
1 parent 1e9e1b1 commit 523984b

File tree

1 file changed

+10
-57
lines changed

1 file changed

+10
-57
lines changed

.github/workflows/release-ci-docker.yml

Lines changed: 10 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
build:
88
runs-on: ubuntu-latest
99
steps:
10-
- name: Free Disk Space (Ubuntu)
10+
- name: Free Disk Space
1111
uses: jlumbroso/free-disk-space@main
1212
with:
1313
tool-cache: false
@@ -17,24 +17,6 @@ jobs:
1717
large-packages: true
1818
docker-images: true
1919
swap-storage: true
20-
21-
- name: Additional cleanup
22-
run: |
23-
echo "Before additional cleanup:"
24-
df -h /
25-
# Remove more unnecessary files
26-
sudo rm -rf /usr/local/lib/android || true
27-
sudo rm -rf /opt/hostedtoolcache || true
28-
sudo rm -rf /usr/share/dotnet || true
29-
sudo rm -rf /opt/ghc || true
30-
sudo rm -rf /usr/local/.ghcup || true
31-
# Clean docker if any exists
32-
docker system prune -af --volumes || true
33-
echo "After additional cleanup:"
34-
df -h /
35-
36-
- name: Show disk space before build
37-
run: df -h /
3820

3921
- uses: actions/checkout@v4
4022

@@ -43,10 +25,6 @@ jobs:
4325

4426
- name: Set up Docker Buildx
4527
uses: docker/setup-buildx-action@v3
46-
with:
47-
driver-opts: |
48-
image=moby/buildkit:latest
49-
network=host
5028

5129
- name: Login to Docker Hub
5230
uses: docker/login-action@v3
@@ -62,40 +40,22 @@ jobs:
6240
platforms: linux/amd64
6341
push: true
6442
tags: |
65-
yongwww/yongwww:amd64-${{ github.sha }}
43+
yongwww/yongwww:amd64
6644
cache-from: type=gha,scope=buildkit-amd64
6745
cache-to: type=gha,scope=buildkit-amd64,mode=min
6846
provenance: false
6947
sbom: false
7048

71-
- name: Aggressive cleanup after AMD64 build
49+
- name: Clean up after AMD64 build
7250
run: |
73-
echo "Disk space before cleanup:"
7451
df -h /
75-
# Stop all buildx builders and remove them
76-
docker buildx stop || true
77-
docker buildx rm --all-inactive --force || true
78-
# Remove ALL docker data
79-
docker system prune -af --volumes || true
80-
# Remove buildx cache
81-
docker buildx prune -af || true
82-
# Clear builder cache
83-
rm -rf ~/.docker/buildx || true
84-
# Remove any temp files
85-
sudo rm -rf /tmp/* || true
86-
sudo rm -rf /var/tmp/* || true
87-
# Clear package manager caches
88-
sudo apt-get clean || true
89-
sudo rm -rf /var/lib/apt/lists/* || true
90-
echo "Disk space after cleanup:"
52+
docker buildx prune -af
53+
docker system prune -af --volumes
54+
sudo rm -rf /tmp/* /var/tmp/* ~/.docker/buildx
9155
df -h /
9256
9357
- name: Re-setup Docker Buildx for ARM64
9458
uses: docker/setup-buildx-action@v3
95-
with:
96-
driver-opts: |
97-
image=moby/buildkit:latest
98-
network=host
9959

10060
- name: Build and push ARM64 image
10161
uses: docker/build-push-action@v5
@@ -105,21 +65,14 @@ jobs:
10565
platforms: linux/arm64
10666
push: true
10767
tags: |
108-
yongwww/yongwww:arm64-${{ github.sha }}
68+
yongwww/yongwww:arm64
10969
cache-from: type=gha,scope=buildkit-arm64
11070
cache-to: type=gha,scope=buildkit-arm64,mode=min
11171
provenance: false
11272
sbom: false
11373

114-
- name: Create and push manifest
74+
- name: Create and push multi-arch manifest
11575
run: |
11676
docker buildx imagetools create -t yongwww/yongwww:latest \
117-
yongwww/yongwww:amd64-${{ github.sha }} \
118-
yongwww/yongwww:arm64-${{ github.sha }}
119-
docker buildx imagetools create -t yongwww/yongwww:${{ github.sha }} \
120-
yongwww/yongwww:amd64-${{ github.sha }} \
121-
yongwww/yongwww:arm64-${{ github.sha }}
122-
123-
- name: Show disk space after build
124-
if: always()
125-
run: df -h /
77+
yongwww/yongwww:amd64 \
78+
yongwww/yongwww:arm64

0 commit comments

Comments
 (0)