Skip to content

Commit

Permalink
Create docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Kittusirkh authored Sep 28, 2024
1 parent 9a20c0e commit 66b3068
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Push Docker Image to Docker Hub

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3

# Log in to Docker Hub with hardcoded credentials (Not recommended for security reasons)
- name: Log in to Docker Hub
run: echo "dckr_pat_bOMBpfnvJjPOSZnmv6ceLjgIghM" | docker login -u "pranavajay" --password-stdin

# Build the Docker image
- name: Build Docker image
run: docker build . -t pranavajay/my-app:latest

# Push the Docker image to Docker Hub
- name: Push Docker image
run: docker push pranavajay/my-app:latest

0 comments on commit 66b3068

Please sign in to comment.