Skip to content

Commit 4052014

Browse files
committed
Add Docker build and push for backend and frontend
1 parent 6f23a6d commit 4052014

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
name: CI Pipeline
1+
name: CI Build and Push
22

33
on:
44
push:
5-
branches: [ "main" ]
6-
workflow_dispatch:
5+
branches: [ main ]
76

87
env:
98
REGISTRY: docker.io
@@ -13,26 +12,32 @@ env:
1312
jobs:
1413
build-and-push:
1514
runs-on: ubuntu-latest
15+
1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@v3
1919

20-
- name: Log in to Docker Hub
21-
uses: docker/login-action@v2
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Log in to DockerHub
24+
uses: docker/login-action@v3
2225
with:
23-
username: ${{ secrets.DOCKERHUB_USERNAME }}
24-
password: ${{ secrets.DOCKERHUB_TOKEN }}
26+
username: ${{ secrets.DOCKER_USERNAME }}
27+
password: ${{ secrets.DOCKER_PASSWORD }}
2528

26-
- name: Build and push Backend image
29+
- name: Build and push backend
2730
uses: docker/build-push-action@v5
2831
with:
2932
context: ./backend
33+
file: ./backend/Dockerfile
3034
push: true
3135
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BACKEND }}:latest
3236

33-
- name: Build and push Frontend image
37+
- name: Build and push frontend
3438
uses: docker/build-push-action@v5
3539
with:
3640
context: ./frontend
41+
file: ./frontend/Dockerfile
3742
push: true
3843
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_FRONTEND }}:latest

0 commit comments

Comments
 (0)