Create docker-image.yml

This commit is contained in:
swastik7777 2024-06-04 10:42:52 +05:30 committed by GitHub
parent a4e9590d1c
commit 034086d1a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 31 additions and 0 deletions

31
.github/workflows/docker-image.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: Build and Push Docker Image
on:
push:
branches:
- main # Change this to the branch you want to trigger the action
jobs:
build-and-push:
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 Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/your-image-name:latest