Skip to content

Commit 938bb6d

Browse files
committed
ci: build and push docker image
Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
1 parent bf9a37e commit 938bb6d

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/docker.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
tags: [ "*" ]
6+
release:
7+
types: [ published ]
8+
9+
jobs:
10+
build-and-push:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up docker buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Login to Docker Hub
24+
uses: docker/login-action@v3
25+
with:
26+
username: ${{ secrets.DOCKER_USERNAME }}
27+
password: ${{ secrets.DOCKER_PASSWORD }}
28+
29+
- name: Extract Docker metadata
30+
id: meta
31+
uses: docker/metadata-action@v5
32+
with:
33+
images: jankaritech/web-app-presentation-viewer
34+
tags: |
35+
type=semver,pattern={{version}}
36+
type=semver,pattern={{major}}.{{minor}}
37+
type=semver,pattern={{major}}
38+
type=raw,value=latest,enable={{is_default_branch}}
39+
40+
- name: Build and push Docker Image
41+
uses: docker/build-push-action@v6
42+
with:
43+
context: .
44+
push: true
45+
tags: ${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)