Skip to content

Commit 4cad388

Browse files
Create push-to-dockerhub.yaml
1 parent 1891ddb commit 4cad388

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Buld server & frontend image and push
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- 'README.md'
9+
- '.gitignore'
10+
- '.dockerignore'
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Docker Build
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Login to DockerHub
24+
uses: docker/login-action@v3
25+
with:
26+
username: ${{ secrets.DOCKERHUB_USERNAME }}
27+
password: ${{ secrets.DOCKERHUB_TOKEN }}
28+
29+
- name: Build and push server Docker image
30+
uses: docker/build-push-action@v6
31+
with:
32+
context: .
33+
file: ./Dockerfile
34+
push: true
35+
tags: saumyashah40/k8s-visualize_backend:latest
36+
37+
- name: Build and push frontend Docker image
38+
uses: docker/build-push-action@v6
39+
with:
40+
context: ./ui
41+
file: ./ui/Dockerfile
42+
push: true
43+
tags: saumyashah40/k8s-visualize:latest
44+
45+

0 commit comments

Comments
 (0)