From 9028d654c1be05abe7d4254ec4b5c9cd5d2dd273 Mon Sep 17 00:00:00 2001 From: realcommang <109267635+realcommang@users.noreply.github.com> Date: Sun, 19 Nov 2023 13:14:41 +0900 Subject: [PATCH] Update build-and-push.yml --- .github/workflows/build-and-push.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index e69de29..4e5f452 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -0,0 +1,26 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Docker + uses: actions/setup-docker@v2 + + - name: Build Docker image + run: docker build -t your-docker-hub-username/your-image-name:latest . + + - name: Log in to Docker Hub + run: docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_PASSWORD }} + + - name: Push Docker image + run: docker push your-docker-hub-username/your-image-name:latest