Skip to content

Commit 50a6e91

Browse files
committed
Add docker hub CI action
1 parent 4d551e9 commit 50a6e91

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/push.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: push
2+
3+
on: push
4+
5+
jobs:
6+
push:
7+
name: Push to Docker Hub
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Docker meta
11+
id: meta
12+
uses: docker/metadata-action@v3
13+
with:
14+
images: your-username/your-image-name
15+
tags: |
16+
type=ref,prefix=dev-,event=branch
17+
type=semver,pattern={{version}}
18+
type=semver,pattern={{major}}
19+
type=semver,pattern={{major}}.{{minor}}
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v1
22+
- name: Login to DockerHub
23+
uses: docker/login-action@v1
24+
with:
25+
username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
- name: Build and push
28+
id: docker_build
29+
uses: docker/build-push-action@v2
30+
with:
31+
push: true
32+
tags: ${{ steps.meta.outputs.tags }}
33+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)