File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Push Docker Image
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ build-and-push :
10
+ runs-on : ubuntu-latest
11
+ permissions :
12
+ contents : read
13
+ packages : write
14
+ steps :
15
+ - name : Checkout code
16
+ uses : actions/checkout@v3
17
+ - name : Set up QEMU
18
+ uses : docker/setup-qemu-action@v3
19
+ - name : Set up Docker Buildx
20
+ uses : docker/setup-buildx-action@v3
21
+
22
+ - name : Login to GitHub Container Registry
23
+ uses : docker/login-action@v3
24
+ with :
25
+ registry : ghcr.io
26
+ username : ${{github.repository_owner}}
27
+ password : ${{secrets.GITHUB_TOKEN}}
28
+ - name : Docker metadata
29
+ id : meta
30
+ uses : docker/metadata-action@v5
31
+ with :
32
+ images : |
33
+ ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
34
+ tags : |
35
+ type=raw,value=latest,enable={{is_default_branch}}
36
+
37
+ - name : Build and push container image
38
+ uses : docker/build-push-action@v6
39
+ id : container-build-push
40
+ with :
41
+ context : .
42
+ platforms : linux/amd64,linux/arm64
43
+ push : true
44
+ tags : ${{ steps.meta.outputs.tags }}
45
+ labels : ${{ steps.meta.outputs.labels }}
46
+ file : Dockerfile
You can’t perform that action at this time.
0 commit comments