Skip to content

Commit

Permalink
Update build-docker.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Suraj-kumar00 authored Oct 10, 2024
1 parent 37d2a7f commit 39f192b
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
name: CI Pipeline
name: Docker Build and Push

on:
push:
branches: [ "main" ]
workflow_dispatch:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Login to DockerHub
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: echo $DOCKER_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
- name: Log in to DockerHub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: Build the Docker image
run: docker build -t surajkumar00/devops-url2qr-api .

- name: Push the Docker image to DockerHub
run: docker push surajkumar00/devops-url2qr-api
- name: Build Docker image
run: docker build -t devops-url2qr-api .

- name: Push Docker image to DockerHub
run: docker push devops-url2qr-api


0 comments on commit 39f192b

Please sign in to comment.