Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
name: Docker Image CI
name: Docker Image CI/CD

on:
push:
branches: [ "main" ]
paths:
- 'Backend/**' # Update path to match your repo
- 'Backend/**'
pull_request:
branches: [ "main" ]
paths:
- 'Backend/**'

jobs:
build:
build-push:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./Backend # Updated path
file: ./Backend/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/sarthi-backend:latest
${{ secrets.DOCKERHUB_USERNAME }}/sarthi-backend:${{ github.sha }}
- name: Checkout code
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./Backend
file: ./Backend/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/sarthi-backend:latest
${{ secrets.DOCKERHUB_USERNAME }}/sarthi-backend:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
Loading