Skip to content

Add GitHub Actions workflow for CI/CD #2

Add GitHub Actions workflow for CI/CD

Add GitHub Actions workflow for CI/CD #2

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push backend image
run: |
docker build -t my-backend:latest -f Dockerfile .
docker push my-backend:latest