From d28ac3295afb76eadb82ccd9515d05c20c93ece1 Mon Sep 17 00:00:00 2001 From: ClasWen Date: Thu, 17 Oct 2024 19:34:36 +0800 Subject: [PATCH 1/5] update action --- .github/workflows/main.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 546f65b..466ad60 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: build-deploy +name: main on: push: @@ -19,9 +19,19 @@ jobs: build: runs-on: ubuntu-latest steps: - # 切换分支 - - name: Checkout - uses: actions/checkout@master + - name: Build container + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + no-cache: true + platforms: linux/amd64 + tags: | + ${{ env.IMAGE_NAME_FULL }}:${{ github.ref_name }} + + build-and-push: + runs-on: ubuntu-latest + steps: - name: Login DockerHub uses: docker/login-action@v2 @@ -31,12 +41,11 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and Push to DockerHub - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile no-cache: true - # target: deploy push: true platforms: linux/amd64 tags: | From d3f4a62986e2574c6e29670c2b50cbd7b2a887f2 Mon Sep 17 00:00:00 2001 From: ClasWen Date: Thu, 17 Oct 2024 19:37:54 +0800 Subject: [PATCH 2/5] update action --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 466ad60..2af6e2b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,8 @@ jobs: build: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + - name: Build container uses: docker/build-push-action@v6 with: @@ -32,6 +34,7 @@ jobs: build-and-push: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Login DockerHub uses: docker/login-action@v2 From 56fa760175a24166d4024f2a0c0e73f7c609a7c1 Mon Sep 17 00:00:00 2001 From: ClasWen Date: Thu, 17 Oct 2024 19:40:25 +0800 Subject: [PATCH 3/5] update action --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2af6e2b..f3def13 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,8 +21,7 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Build container - uses: docker/build-push-action@v6 + - uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile @@ -33,28 +32,29 @@ jobs: build-and-push: runs-on: ubuntu-latest + needs: build steps: - uses: actions/checkout@v4 - - name: Login DockerHub + - name: Login uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and Push to DockerHub + - name: Build and Push uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile - no-cache: true + no-cache: false push: true platforms: linux/amd64 tags: | ${{ env.IMAGE_NAME_FULL }}:${{ github.ref_name }} - - name: ssh pipelines + - name: Deploy uses: appleboy/ssh-action@v1.0.0 env: BRANCH_NAME: ${{ github.ref_name }} From a80dd6fd2fd087a8e92b1da15b6af50d9c0b6040 Mon Sep 17 00:00:00 2001 From: ClasWen Date: Thu, 17 Oct 2024 19:45:35 +0800 Subject: [PATCH 4/5] update action --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f3def13..8416256 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,7 +48,7 @@ jobs: with: context: . file: ./Dockerfile - no-cache: false + no-cache: true push: true platforms: linux/amd64 tags: | From 781f80fae75006b05748837451696c243b2d1357 Mon Sep 17 00:00:00 2001 From: ClasWen Date: Thu, 17 Oct 2024 19:50:47 +0800 Subject: [PATCH 5/5] update action --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8416256..aa2b0ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: no-cache: true platforms: linux/amd64 tags: | - ${{ env.IMAGE_NAME_FULL }}:${{ github.ref_name }} + ${{ env.IMAGE_NAME_FULL }} build-and-push: runs-on: ubuntu-latest