From e825baef79695c68d4af27699cd1baf4a723c7b2 Mon Sep 17 00:00:00 2001 From: A3888S Date: Thu, 19 Dec 2024 19:24:17 +0000 Subject: [PATCH] step-final update --- .github/workflows/docker-build.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index e69de29..f11a723 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,27 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build Docker Image + run: | + docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/step-final-project:v1.0.0 . + + - name: Push Docker Image + run: | + docker push ${{ secrets.DOCKERHUB_USERNAME }}/step-final-project:v1.0.0