Skip to content

Commit b3aaa38

Browse files
chore: 🤖 Publish docker image on releases (#42)
1 parent 166bd1d commit b3aaa38

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish Docker image to docker hub
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
release:
8+
type: [published]
9+
10+
jobs:
11+
push_to_registry:
12+
name: Push Docker image to Docker Hub
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out the repo
16+
uses: actions/checkout@v2
17+
18+
- name: Log in to Docker Hub
19+
uses: docker/login-action@v1
20+
with:
21+
username: ${{ secrets.DOCKER_USERNAME }}
22+
password: ${{ secrets.DOCKER_PASSWORD }}
23+
24+
- name: Extract metadata (tags, labels) for Docker
25+
id: meta
26+
uses: docker/metadata-action@v3
27+
with:
28+
images: ${{ secrets.DOCKER_HUB_REPO }}
29+
30+
- name: Build and push Docker image
31+
uses: docker/build-push-action@v2
32+
with:
33+
context: .
34+
push: true
35+
tags: ${{ steps.meta.outputs.tags }}
36+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)