7
7
build :
8
8
runs-on : ubuntu-latest
9
9
steps :
10
- - name : Free Disk Space (Ubuntu)
10
+ - name : Free Disk Space
11
11
uses : jlumbroso/free-disk-space@main
12
12
with :
13
13
tool-cache : false
17
17
large-packages : true
18
18
docker-images : true
19
19
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 /
38
20
39
21
- uses : actions/checkout@v4
40
22
43
25
44
26
- name : Set up Docker Buildx
45
27
uses : docker/setup-buildx-action@v3
46
- with :
47
- driver-opts : |
48
- image=moby/buildkit:latest
49
- network=host
50
28
51
29
- name : Login to Docker Hub
52
30
uses : docker/login-action@v3
@@ -62,40 +40,22 @@ jobs:
62
40
platforms : linux/amd64
63
41
push : true
64
42
tags : |
65
- yongwww/yongwww:amd64-${{ github.sha }}
43
+ yongwww/yongwww:amd64
66
44
cache-from : type=gha,scope=buildkit-amd64
67
45
cache-to : type=gha,scope=buildkit-amd64,mode=min
68
46
provenance : false
69
47
sbom : false
70
48
71
- - name : Aggressive cleanup after AMD64 build
49
+ - name : Clean up after AMD64 build
72
50
run : |
73
- echo "Disk space before cleanup:"
74
51
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
91
55
df -h /
92
56
93
57
- name : Re-setup Docker Buildx for ARM64
94
58
uses : docker/setup-buildx-action@v3
95
- with :
96
- driver-opts : |
97
- image=moby/buildkit:latest
98
- network=host
99
59
100
60
- name : Build and push ARM64 image
101
61
uses : docker/build-push-action@v5
@@ -105,21 +65,14 @@ jobs:
105
65
platforms : linux/arm64
106
66
push : true
107
67
tags : |
108
- yongwww/yongwww:arm64-${{ github.sha }}
68
+ yongwww/yongwww:arm64
109
69
cache-from : type=gha,scope=buildkit-arm64
110
70
cache-to : type=gha,scope=buildkit-arm64,mode=min
111
71
provenance : false
112
72
sbom : false
113
73
114
- - name : Create and push manifest
74
+ - name : Create and push multi-arch manifest
115
75
run : |
116
76
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