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 /
20
38
21
39
- uses : actions/checkout@v4
22
40
@@ -25,20 +43,60 @@ jobs:
25
43
26
44
- name : Set up Docker Buildx
27
45
uses : docker/setup-buildx-action@v3
46
+ with :
47
+ driver-opts : |
48
+ image=moby/buildkit:latest
49
+ network=host
28
50
29
51
- name : Login to Docker Hub
30
52
uses : docker/login-action@v3
31
53
with :
32
54
username : yongwww
33
55
password : ${{ secrets.DOCKERHUB_TOKEN }}
34
56
35
- - name : Build and push multi-arch image
57
+ - name : Build and push AMD64 image
58
+ uses : docker/build-push-action@v5
59
+ with :
60
+ context : docker
61
+ file : docker/Dockerfile.ci_gpu
62
+ platforms : linux/amd64
63
+ push : true
64
+ tags : |
65
+ yongwww/yongwww:amd64-${{ github.sha }}
66
+ cache-from : type=gha,scope=buildkit-amd64
67
+ cache-to : type=gha,scope=buildkit-amd64,mode=min
68
+ provenance : false
69
+ sbom : false
70
+
71
+ - name : Clean between builds
72
+ run : |
73
+ docker system prune -af --volumes || true
74
+ echo "Disk space after AMD64 build:"
75
+ df -h /
76
+
77
+ - name : Build and push ARM64 image
36
78
uses : docker/build-push-action@v5
37
79
with :
38
80
context : docker
39
81
file : docker/Dockerfile.ci_gpu
40
- platforms : linux/amd64,linux/ arm64
82
+ platforms : linux/arm64
41
83
push : true
42
84
tags : |
43
- yongwww/yongwww:latest
44
- yongwww/yongwww:${{ github.sha }}
85
+ yongwww/yongwww:arm64-${{ github.sha }}
86
+ cache-from : type=gha,scope=buildkit-arm64
87
+ cache-to : type=gha,scope=buildkit-arm64,mode=min
88
+ provenance : false
89
+ sbom : false
90
+
91
+ - name : Create and push manifest
92
+ run : |
93
+ docker buildx imagetools create -t yongwww/yongwww:latest \
94
+ yongwww/yongwww:amd64-${{ github.sha }} \
95
+ yongwww/yongwww:arm64-${{ github.sha }}
96
+ docker buildx imagetools create -t yongwww/yongwww:${{ github.sha }} \
97
+ yongwww/yongwww:amd64-${{ github.sha }} \
98
+ yongwww/yongwww:arm64-${{ github.sha }}
99
+
100
+ - name : Show disk space after build
101
+ if : always()
102
+ run : df -h /
0 commit comments