From e3fded16acf9745b7b13a3d4d985150063e2d739 Mon Sep 17 00:00:00 2001 From: DDSDerek <108336573+DDSDerek@users.noreply.github.com> Date: Sat, 30 Dec 2023 14:22:26 +0800 Subject: [PATCH] feat: support arm64 architecture (#15) Co-authored-by: DDSRem <1448139087@qq.com> --- .github/workflows/docker-image-debug.yml | 25 ++++++++++++++++++---- .github/workflows/docker-image.yml | 27 +++++++++++++++++++----- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-image-debug.yml b/.github/workflows/docker-image-debug.yml index e05c6ff..b5147b1 100644 --- a/.github/workflows/docker-image-debug.yml +++ b/.github/workflows/docker-image-debug.yml @@ -12,18 +12,35 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ secrets.DOCKER_USERNAME }}/bili-sync + tags: | + type=raw,value=debug + - + name: Set Up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set Up Buildx + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - + - name: Build and push images uses: docker/build-push-action@v5 with: context: . - file: ./Dockerfile + file: Dockerfile + platforms: | + linux/amd64 + linux/arm64/v8 push: true - tags: | - ${{ secrets.DOCKERHUB_USERNAME }}/bili-sync:debug \ No newline at end of file + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 9b845e2..3c3938f 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -12,22 +12,39 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ secrets.DOCKER_USERNAME }}/bili-sync + tags: | + type=raw,value=${{ github.ref_name }} + type=raw,value=latest + - + name: Set Up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set Up Buildx + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - + - name: Build and push images uses: docker/build-push-action@v5 with: context: . - file: ./Dockerfile + file: Dockerfile + platforms: | + linux/amd64 + linux/arm64/v8 push: true - tags: | - ${{ secrets.DOCKERHUB_USERNAME }}/bili-sync:${{ github.ref_name }} - ${{ secrets.DOCKERHUB_USERNAME }}/bili-sync:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} - name: Update DockerHub description uses: peter-evans/dockerhub-description@v3