File tree Expand file tree Collapse file tree 1 file changed +45
-8
lines changed Expand file tree Collapse file tree 1 file changed +45
-8
lines changed Original file line number Diff line number Diff line change 1
1
name : Docker Image CI
2
2
3
- on : [push, pull_request]
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ tags :
8
+ - " *"
4
9
5
- jobs :
10
+ permissions :
11
+ contents : read
12
+ packages : write
6
13
14
+ jobs :
7
15
docker-build :
8
-
9
16
runs-on : ubuntu-latest
10
-
11
17
steps :
12
- - name : Checkout
13
- uses : actions/checkout@v4
14
- - name : Build the Docker image
15
- run : docker build . --file Dockerfile --tag spellcheck:$(date +%s)
18
+ - name : Checkout
19
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
20
+
21
+ - name : Set up QEMU
22
+ uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # ratchet:docker/setup-qemu-action@v3
23
+
24
+ - name : Set up Docker Buildx
25
+ uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # ratchet:docker/setup-buildx-action@v3
26
+
27
+ - name : Login to GitHub Registry
28
+ uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # ratchet:docker/login-action@v3
29
+ with :
30
+ registry : ghcr.io
31
+ username : ${{ github.actor }}
32
+ password : ${{ secrets.GITHUB_TOKEN }}
33
+
34
+ - name : Metadata for the image
35
+ id : meta
36
+ uses : docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # ratchet:docker/metadata-action@v5
37
+ with :
38
+ images : ghcr.io/${{ github.repository }}
39
+ tags : |
40
+ type=sha
41
+ type=ref,event=branch
42
+ type=ref,event=pr
43
+ type=semver,pattern={{version}}
44
+
45
+ - name : Build container
46
+ uses : docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # ratchet:docker/build-push-action@v6
47
+ with :
48
+ platforms : " linux/amd64,linux/arm64"
49
+ cache-from : type=gha
50
+ cache-to : type=gha,mode=max
51
+ push : true
52
+ tags : ${{ steps.meta.outputs.tags }}
You can’t perform that action at this time.
0 commit comments