From 6fc2baac69a45dd912a07fd0cb60043faa1c9f5a Mon Sep 17 00:00:00 2001 From: iMaeGoo Date: Mon, 4 Sep 2023 17:22:27 +0800 Subject: [PATCH] ci: configure needs --- .github/workflows/docker-image.yml | 53 ------------------------------ .github/workflows/publish.yml | 46 ++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 56 deletions(-) delete mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index a40eb36ad..000000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Docker Image CI - -on: - release: - types: [published] - workflow_dispatch: - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Get twikoo:latest version - run: echo "TWIKOO_LATEST_VERSION=$(npm view twikoo@latest version)" >> "$GITHUB_ENV" - - - name: Build and push amd64 image - uses: docker/build-push-action@v3 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: | - imaegoo/twikoo:latest - imaegoo/twikoo:${{ env.TWIKOO_LATEST_VERSION }} - - - name: Build and push arm32v7 image - uses: docker/build-push-action@v3 - with: - context: . - platforms: linux/arm/v7 - push: true - tags: | - imaegoo/twikoo:arm32v7 - imaegoo/twikoo:${{ env.TWIKOO_LATEST_VERSION }}-arm32v7 - build-args: NODE_IMAGE=arm32v7/node diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4a0985e7c..fd6b5eb4a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,3 @@ -# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created -# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages - name: Publish on: @@ -51,3 +48,46 @@ jobs: run: cd src/server/self-hosted && yarn publish env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} + publish-docker: + needs: publish-npm + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - + name: Get twikoo:latest version + run: echo "TWIKOO_LATEST_VERSION=$(npm view twikoo@latest version)" >> "$GITHUB_ENV" + - + name: Build and push amd64 image + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: | + imaegoo/twikoo:latest + imaegoo/twikoo:${{ env.TWIKOO_LATEST_VERSION }} + - + name: Build and push arm32v7 image + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/arm/v7 + push: true + tags: | + imaegoo/twikoo:arm32v7 + imaegoo/twikoo:${{ env.TWIKOO_LATEST_VERSION }}-arm32v7 + build-args: NODE_IMAGE=arm32v7/node