From c124e06ee894767959eeb1f15f62eaade7710f78 Mon Sep 17 00:00:00 2001 From: upa-r-upa Date: Wed, 10 Jul 2024 01:02:49 +0900 Subject: [PATCH] chore: Add `build-push on docker hub` action --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++ .github/workflows/{main.yml => test.yml} | 0 docker-compose.yml | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml rename .github/workflows/{main.yml => test.yml} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..72ab48c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +name: Build, Push on Docker Hub + +on: + push: + branches: + - main + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + push: true + file: ./Dockerfile + tags: ${{ env.DOCKER_IMAGE_TAG }} + platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/main.yml b/.github/workflows/test.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/test.yml diff --git a/docker-compose.yml b/docker-compose.yml index e02c5c2..0502465 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ services: container_name: taskie-backend-container image: taskie-backend ports: - - "8000:8000" + - "88:8000" environment: JWT_SECRET_KEY: ${JWT_SECRET_KEY} TSK_DB_URL: ${TSK_DB_URL}