From 469b2a15c9a3afc521bab2946cf3b5d8209f5b33 Mon Sep 17 00:00:00 2001 From: Kim Yejun <53390015+idoyo7@users.noreply.github.com> Date: Sun, 4 Aug 2024 21:12:34 +0900 Subject: [PATCH] Create docker-image.yml --- .github/workflows/docker-image.yml | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..7fbeb81 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,31 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - main + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + 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.REPO_USER }} + password: ${{ secrets.REPO_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ vars.REPO_URL }}/test:latest