From 2087e692aeb5704b83f41fceb82403d30f0a8966 Mon Sep 17 00:00:00 2001 From: devYuMinKim Date: Thu, 13 Jun 2024 18:59:50 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Update=20CI=20workflow=20to=20us?= =?UTF-8?q?e=20docker/build-push-action=20for=20Docker=20image=20publishin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replaced `ko publish` with `docker/build-push-action` to ensure correct Docker image push to ghcr.io/yju-okura/minori_gin. - Set up Docker Buildx for multi-platform builds. - Added steps to cache Go modules and environment setup. Related issue: #177 --- .github/workflows/ci.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d88a9f..668eb76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,23 +49,23 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.PASSWORD }} - - name: Build and push image using ko - env: - KO_DOCKER_REPO: ghcr.io/yju-okura/minori_gin - PATH: $PATH:~/go/bin - run: | - ko publish . -B --tags=${{ env.date }},latest -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v3 -# -# - name: Build and push -# uses: docker/build-push-action@v3 -# with: -# context: . -# file: ./Dockerfile -# platforms: linux/amd64 -# push: true -# no-cache: true -# tags: | -# ghcr.io/yju-okura/minori_gin:${{ env.date }} -# ghcr.io/yju-okura/minori_gin:latest +# - name: Build and push image using ko +# env: +# KO_DOCKER_REPO: ghcr.io/yju-okura/minori_gin +# PATH: $PATH:~/go/bin +# run: | +# ko publish . -B --tags=${{ env.date }},latest + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64 + push: true + no-cache: true + tags: | + ghcr.io/yju-okura/minori_gin:${{ env.date }} + ghcr.io/yju-okura/minori_gin:latest \ No newline at end of file