@@ -3,7 +3,7 @@ name: Docker CI
3
3
on :
4
4
pull_request :
5
5
branches : ['main']
6
- paths : ['Dockerfile','bin','config/**','.github/workflows/ci-docker.yml']
6
+ paths : ['Dockerfile','bin/** ','config/**','.github/workflows/ci-docker.yml']
7
7
8
8
env :
9
9
REGISTRY : ghcr.io
@@ -17,36 +17,69 @@ jobs:
17
17
- name : qemu
18
18
uses : docker/setup-qemu-action@v1
19
19
- uses : docker/setup-buildx-action@v1
20
+ - uses : actions/cache@v3
21
+ with :
22
+ path : /tmp/.buildx-cache
23
+ key : ${{ runner.os }}-buildx-${{ github.sha }}
24
+ restore-keys : |
25
+ ${{ runner.os }}-buildx-
20
26
- id : meta
21
27
uses : docker/metadata-action@v3
22
28
with :
23
29
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
30
+ flavor : |
31
+ latest=false
32
+ suffix=-amd64
24
33
- name : build
25
34
uses : docker/build-push-action@v2
26
35
with :
27
36
context : .
28
37
push : false
29
38
tags : ${{ steps.meta.outputs.tags }}
30
39
labels : ${{ steps.meta.outputs.labels }}
31
- cache-from : type=gha
32
- cache-to : type=gha,mode=max
40
+ cache-from : type=local,src=/tmp/.buildx-cache
41
+ cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max
42
+ # TEMP fix
43
+ # https://github.com/docker/build-push-action/issues/252
44
+ # https://github.com/moby/buildkit/issues/1896
45
+ - name : cache
46
+ run : |
47
+ rm -rf /tmp/.buildx-cache
48
+ mv /tmp/.buildx-cache-new /tmp/.buildx-cache
49
+
33
50
build-arm64 :
34
51
runs-on : self-hosted
35
52
steps :
36
53
- uses : actions/checkout@v2
37
54
- name : qemu
38
55
uses : docker/setup-qemu-action@v1
39
56
- uses : docker/setup-buildx-action@v1
57
+ - uses : actions/cache@v3
58
+ with :
59
+ path : /tmp/.buildx-cache
60
+ key : ${{ runner.os }}-buildx-${{ github.sha }}
61
+ restore-keys : |
62
+ ${{ runner.os }}-buildx-
40
63
- id : meta
41
64
uses : docker/metadata-action@v3
42
65
with :
43
66
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
67
+ flavor : |
68
+ latest=false
69
+ suffix=-arm64v8
44
70
- name : build
45
71
uses : docker/build-push-action@v2
46
72
with :
47
73
context : .
48
74
push : false
49
75
tags : ${{ steps.meta.outputs.tags }}
50
76
labels : ${{ steps.meta.outputs.labels }}
51
- cache-from : type=gha
52
- cache-to : type=gha,mode=max
77
+ cache-from : type=local,src=/tmp/.buildx-cache
78
+ cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max
79
+ # TEMP fix
80
+ # https://github.com/docker/build-push-action/issues/252
81
+ # https://github.com/moby/buildkit/issues/1896
82
+ - name : cache
83
+ run : |
84
+ rm -rf /tmp/.buildx-cache
85
+ mv /tmp/.buildx-cache-new /tmp/.buildx-cache
0 commit comments