File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish Docker Image
2
+
3
+ on :
4
+ push :
5
+ branches : [main]
6
+ release :
7
+ types : [published]
8
+
9
+ jobs :
10
+ publish-to-dockerhub :
11
+ name : Push Docker image to Docker Hub
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - name : Check out the repo
15
+ uses : actions/checkout@v3
16
+
17
+ - name : Log in to Docker Hub
18
+ uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
19
+ with :
20
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
21
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
22
+
23
+ - name : Extract metadata (tags, labels) for Docker
24
+ id : meta
25
+ uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
26
+ with :
27
+ images : codfish/json-server
28
+
29
+ - name : Build and push Docker image
30
+ uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
31
+ with :
32
+ context : .
33
+ push : true
34
+ tags : ${{ steps.meta.outputs.tags }}
35
+ labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments