Commit c4ae81b 1 parent 4fa076a commit c4ae81b Copy full SHA for c4ae81b
File tree 1 file changed +45
-0
lines changed
1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Publish Docker image
2
+
3
+ on :
4
+ push :
5
+ branches : ['main']
6
+
7
+ env :
8
+ REGISTRY : ghcr.io
9
+ IMAGE_NAME : ${{ github.repository }}
10
+
11
+ jobs :
12
+ push_to_registry :
13
+ name : Push Docker image to ghcr registry
14
+ runs-on : ubuntu-latest
15
+ permissions :
16
+ packages : write
17
+ contents : read
18
+
19
+ steps :
20
+ - name : Check out the repo
21
+ uses : actions/checkout@v4
22
+
23
+ - name : Log in to the Github Container registry
24
+ uses : docker/login-action@v3
25
+ with :
26
+ registry : ghcr.io
27
+ username : ${{ github.actor }}
28
+ password : ${{ secrets.GITHUB_TOKEN }}
29
+
30
+ - name : Extract metadata (tags, labels) for Docker
31
+ id : meta
32
+ uses : docker/metadata-action@1294d94f8ee362ab42b6da04c35f4cd03a0e6af7
33
+ with :
34
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35
+ tags : |
36
+ type=ref,event=branch,suffix=_{{sha}}
37
+ type=raw,value=latest,enable={{is_default_branch}}
38
+
39
+ - name : Build and push Docker images
40
+ uses : docker/build-push-action@v5
41
+ with :
42
+ context : .
43
+ push : true
44
+ tags : ${{ steps.meta.outputs.tags }}
45
+ labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments