Skip to content

Commit f5f08c1

Browse files
committed
Add docker-image workflow
1 parent 6219df0 commit f5f08c1

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
9+
jobs:
10+
build-and-push:
11+
name: Build and Push Docker Image
12+
runs-on: ubuntu-latest
13+
environment: Dockerhub
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Log in to Docker Hub
20+
uses: docker/login-action@v3
21+
with:
22+
username: ${{ secrets.DOCKERHUB_USERNAME }}
23+
password: ${{ secrets.DOCKERHUB_TOKEN }}
24+
25+
- name: Extract metadata (tags, labels) for Docker
26+
id: meta
27+
uses: docker/metadata-action@v5
28+
with:
29+
images: ${{ secrets.DOCKERHUB_USERNAME }}/minimediametadataapi
30+
tags: |
31+
type=ref,event=branch
32+
type=sha
33+
34+
- name: Build and push Docker image
35+
uses: docker/build-push-action@v5
36+
with:
37+
context: .
38+
file: MiniMediaMetadataAPI/Dockerfile
39+
push: true
40+
tags: ${{ steps.meta.outputs.tags }}
41+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)