From 6e344a23afd2936693c66bfeaed4b2e75a50673d Mon Sep 17 00:00:00 2001 From: Cassius0924 <2670226747@qq.com> Date: Fri, 8 Mar 2024 16:46:31 +0800 Subject: [PATCH 1/4] Update and rename docker-image.yml to docker-image-on-push.yml --- .../{docker-image.yml => docker-image-on-push.yml} | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) rename .github/workflows/{docker-image.yml => docker-image-on-push.yml} (80%) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image-on-push.yml similarity index 80% rename from .github/workflows/docker-image.yml rename to .github/workflows/docker-image-on-push.yml index 397ae29..8a1ec16 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image-on-push.yml @@ -15,15 +15,19 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Docker Setup Buildx + uses: docker/setup-buildx-action@v3.1.0 + - name: Docker Login uses: docker/login-action@v3.0.0 with: username: cassius0924 password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - + - name: Build and push Docker image uses: docker/build-push-action@v5.2.0 with: context: . + platforms: linux/amd64,linux/arm64 push: true tags: cassius0924/wechatter:latest From 55f4e27ce558126e897593965853e42a27876100 Mon Sep 17 00:00:00 2001 From: Cassius0924 <2670226747@qq.com> Date: Fri, 8 Mar 2024 16:48:39 +0800 Subject: [PATCH 2/4] Update docker-image-on-push.yml --- .github/workflows/docker-image-on-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image-on-push.yml b/.github/workflows/docker-image-on-push.yml index 8a1ec16..7c8beae 100644 --- a/.github/workflows/docker-image-on-push.yml +++ b/.github/workflows/docker-image-on-push.yml @@ -1,4 +1,4 @@ -name: Build and Push Docker Image +name: Build and Push Docker Image On Push on: push: From 67337feaa7df809947d418cbf6dcb2c4093f538b Mon Sep 17 00:00:00 2001 From: Cassius0924 <2670226747@qq.com> Date: Fri, 8 Mar 2024 16:51:07 +0800 Subject: [PATCH 3/4] Update docker-image-on-push.yml --- .github/workflows/docker-image-on-push.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docker-image-on-push.yml b/.github/workflows/docker-image-on-push.yml index 7c8beae..b4b24e5 100644 --- a/.github/workflows/docker-image-on-push.yml +++ b/.github/workflows/docker-image-on-push.yml @@ -15,6 +15,9 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3.0.0 + - name: Docker Setup Buildx uses: docker/setup-buildx-action@v3.1.0 From 9726c1290a865b47152a71256a2122966315eef5 Mon Sep 17 00:00:00 2001 From: Cassius0924 <2670226747@qq.com> Date: Fri, 8 Mar 2024 16:55:31 +0800 Subject: [PATCH 4/4] Create docker-image-on-release.yml --- .github/workflows/docker-image-on-release.yml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/docker-image-on-release.yml diff --git a/.github/workflows/docker-image-on-release.yml b/.github/workflows/docker-image-on-release.yml new file mode 100644 index 0000000..c5f2b60 --- /dev/null +++ b/.github/workflows/docker-image-on-release.yml @@ -0,0 +1,36 @@ +name: Build and Push Docker Image On Release + +on: + release: + types: + - published + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3.0.0 + + - name: Docker Setup Buildx + uses: docker/setup-buildx-action@v3.1.0 + + - name: Docker Login + uses: docker/login-action@v3.0.0 + with: + username: cassius0924 + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5.2.0 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: cassius0924/wechatter:${{ github.event.release.tag_name }}