From e6ac8647a2269fdc25b50a9cee92b07ec1071538 Mon Sep 17 00:00:00 2001 From: herniy <2667004988@qq.com> Date: Tue, 6 Aug 2024 15:56:43 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BD=BF=E7=94=A8=20Actions=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=92=8C=E5=8F=91=E5=B8=83=20Docker=20?= =?UTF-8?q?=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-image.yml | 39 ++++++++++++++++++++++++++++++ README.md | 1 + README_EN.md | 1 + 3 files changed, 41 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..8928912 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,39 @@ +name: Build and Push Docker Image + +on: + release: + types: [published] + workflow_dispatch: # 允许手动触发工作流 + +jobs: + publish-docker: + runs-on: ubuntu-latest + + steps: + - name: 拉取源码 + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: 设置 QEMU + uses: docker/setup-qemu-action@v3 + + - name: 设置 Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: 登录到 DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: 构建和推送 Docker hub + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/xhs-downloader:${{ github.event.release.tag_name }} + + - name: Post build notifications + run: echo "Docker image has been built and pushed successfully" diff --git a/README.md b/README.md index 6e9e522..d6a4ea1 100644 --- a/README.md +++ b/README.md @@ -382,6 +382,7 @@ async def example():

如果您愿意,可以考虑提供资助为 XHS-Downloader 提供额外的支持!

✉️ 联系作者