From 5ed310a151acf53c30a55779881e4d216a1e733d Mon Sep 17 00:00:00 2001 From: Sunwu Park <52268188+sunwupark@users.noreply.github.com> Date: Tue, 21 May 2024 01:57:31 +0900 Subject: [PATCH] :fix docker.yml using this branch --- .github/workflows/docker.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index af85e93..0797879 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -3,7 +3,7 @@ name: main Workflow on: push: branches: - - main + - develop jobs: build: runs-on: ubuntu-latest @@ -21,8 +21,8 @@ jobs: mkdir -p src/main/resources echo "${{ secrets.MAIN_DATABASE_YML }}" | base64 --decode > src/main/resources/application.yml - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Run chmod to make gradlew executable run: chmod +x ./gradlew @@ -30,12 +30,23 @@ jobs: - name: Build with Gradle run: ./gradlew clean build --exclude-task test + - name: Login to Docker hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + ## 웹 이미지 빌드 및 도커허브에 push - - name: web docker build and push - run: | - docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - docker build -t ${{ secrets.DOCKER_REPO }}/meme-service . - docker push ${{ secrets.DOCKER_REPO }}/meme-service + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: sunwupark/meme-service:latest + platforms: | + linux/amd64 + linux/arm64 + linux/arm/v7 - name: EC2 docker remove uses: appleboy/ssh-action@v0.1.6