File tree 2 files changed +63
-0
lines changed
2 files changed +63
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : docker-hub
2
+
3
+ on :
4
+ push :
5
+ branches : [ master ]
6
+ paths :
7
+ - Dockerfile
8
+ - entrypoint.*
9
+ - requirements.txt
10
+ pull_request :
11
+ branches : [ master ]
12
+ paths :
13
+ - Dockerfile
14
+ - entrypoint.*
15
+ - requirements.txt
16
+ workflow_dispatch :
17
+
18
+ env :
19
+ REGISTRY : laniksj
20
+ IMAGE_NAME : ${{ github.repository }}
21
+
22
+ jobs :
23
+ build-and-push-image :
24
+ runs-on : ubuntu-latest
25
+ permissions :
26
+ contents : read
27
+ packages : write
28
+
29
+ steps :
30
+ - name : Checkout Repository
31
+ uses : actions/checkout@v4
32
+
33
+ - name : Login to Docker Hub
34
+ uses : docker/login-action@v3
35
+ with :
36
+ username : ${{ env.REGISTRY }}
37
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
38
+
39
+ - name : Extract Metadata (tags, labels) for Docker
40
+ id : meta
41
+ uses : docker/metadata-action@v5
42
+ with :
43
+ images : ${{ env.IMAGE_NAME }}
44
+ tags : |
45
+ type=raw,value=latest
46
+ type=ref,event=branch
47
+
48
+ - name : Set up Docker Buildx
49
+ id : buildx
50
+ uses : docker/setup-buildx-action@v3
51
+ with :
52
+ install : true
53
+
54
+ - name : Build and Push Docker Image
55
+ uses : docker/build-push-action@v5
56
+ with :
57
+ builder : ${{ steps.buildx.outputs.name }}
58
+ context : .
59
+ platforms : ' linux/amd64,linux/arm64'
60
+ push : true
61
+ tags : ${{ steps.meta.outputs.tags }}
62
+ labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 11
11
paths :
12
12
- config/*
13
13
- Dockerfile
14
+ workflow_dispatch :
14
15
15
16
env :
16
17
REGISTRY : ghcr.io
You can’t perform that action at this time.
0 commit comments