@@ -2,8 +2,7 @@ name: docker-build
22
33on :
44 push :
5- branches :
6- - main
5+ pull_request :
76
87jobs :
98 multi-arch-push :
1211 -
1312 name : Checkout
1413 uses : actions/checkout@v4
15- with :
16- fetch-depth : 0
1714 -
1815 name : Set up Docker Buildx
1916 uses : docker/setup-buildx-action@v3
20- -
21- name : Cache Docker layers
22- uses : actions/cache@v4
23- with :
24- path : /tmp/.buildx-cache
25- key : ${{ runner.os }}-buildx-${{ github.sha }}
26- restore-keys : |
27- ${{ runner.os }}-buildx-
2817 -
2918 name : Login to GitHub Registry
3019 uses : docker/login-action@v3
@@ -39,21 +28,12 @@ jobs:
3928 username : erisamoe
4029 password : ${{ secrets.DOCKERHUB_TOKEN }}
4130 -
42- name : Get Latest Tag
43- id : previoustag
44- uses :
WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce # [email protected] 45- -
46- name : Build and push
47- uses : docker/build-push-action@v5
31+ name : Bake image
32+ uses : docker/bake-action@v6
33+ env :
34+ MULTI_PLATFORM : true
4835 with :
49- context : .
50- file : ./Dockerfile
51- platforms : linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6,linux/s390x,linux/ppc64le,linux/riscv64
52- push : true
53- tags : |
54- erisamoe/cloudflared:latest
55- erisamoe/cloudflared:${{ steps.previoustag.outputs.tag }}
56- ghcr.io/erisa/cloudflared:latest
57- ghcr.io/erisa/cloudflared:${{ steps.previoustag.outputs.tag }}
58- cache-from : type=local,src=/tmp/.buildx-cache
59- cache-to : type=local,dest=/tmp/.buildx-cache
36+ push : ${{ github.ref == 'refs/heads/main' }}
37+ set : |
38+ *.cache-from=type=gha
39+ *.cache-to=type=gha,mode=max
0 commit comments