88permissions :
99 contents : write
1010jobs :
11- image-amd64 :
12- runs-on : ubuntu-latest
13- steps :
14- - name : Checkout
15- uses : actions/checkout@v4
16- with :
17- fetch-depth : 0
18- - name : Set up Go
19- uses : actions/setup-go@v5
20- with :
21- go-version-file : go.mod
22-
23- - name : Setup Docker Buildx
24- uses : docker/setup-buildx-action@v3
25- with :
26- version : v0.11.2
27- install : true
28-
29- # <--- Login, build and push image to Docker Hub --->
30- - name : Login to Docker Hub
31- uses : docker/login-action@v3
32- with :
33- username : ${{ secrets.DOCKER_USERNAME }}
34- password : ${{ secrets.DOCKER_PASSWORD }}
35-
36- - name : Extract metadata (tags, labels) for Docker
37- id : meta
38- uses : docker/metadata-action@v5
39- with :
40- images : kcllang/kcl
41- - name : Build and push Docker image
42- uses : docker/build-push-action@v6
43- with :
44- context : .
45- platforms : linux/amd64
46- push : ${{ github.event_name != 'pull_request' }}
47- tags : ${{ steps.meta.outputs.tags }}
48- labels : ${{ steps.meta.outputs.labels }}
49-
50- image-arm64 :
11+ image :
12+ outputs :
13+ hashes : ${{ steps.hash.outputs.hashes }}
14+ image_url : ${{ steps.hash.outputs.image_url }}
15+ image_digest : ${{ steps.hash.outputs.image_digest }}
5116 runs-on : ubuntu-latest
5217 steps :
5318 - name : Checkout
@@ -61,32 +26,40 @@ jobs:
6126
6227 - name : Setup QEMU
6328 uses : docker/setup-qemu-action@v3
64- with :
65- platforms : all
6629 - name : Setup Docker Buildx
30+ id : buildx
6731 uses : docker/setup-buildx-action@v3
32+ - name : Docker login ghcr.io
33+ uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
6834 with :
69- version : v0.11.2
70- install : true
71-
72- # <--- Login, build and push image to Docker Hub --->
73- - name : Login to Docker Hub
74- uses : docker/login-action@v3
35+ registry : ghcr.io
36+ username : kclbot
37+ password : ${{ secrets.DEPLOY_ACCESS_TOKEN }}
38+ - name : Docker login docker.io
39+ uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
7540 with :
7641 username : ${{ secrets.DOCKER_USERNAME }}
7742 password : ${{ secrets.DOCKER_PASSWORD }}
78-
79- - name : Extract metadata (tags, labels) for Docker
43+ - name : Docker meta
8044 id : meta
81- uses : docker/metadata-action@v5
45+ uses : docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
8246 with :
83- images : kcllang/kcl-arm64
47+ images : |
48+ kcllang/kcl
49+ ghcr.io/kcl-lang/kcl
50+ tags : |
51+ type=raw,value=v0.10.6
52+
8453 - name : Build and push Docker image
8554 uses : docker/build-push-action@v6
8655 with :
56+ sbom : true
57+ provenance : true
58+ push : true
59+ builder : ${{ steps.buildx.outputs.name }}
8760 context : .
88- platforms : linux/arm64
89- push : ${{ github.event_name != 'pull_request' }}
61+ file : ./Dockerfile
62+ platforms : linux/amd64,linux/arm64
9063 tags : ${{ steps.meta.outputs.tags }}
9164 labels : ${{ steps.meta.outputs.labels }}
9265
0 commit comments