From c17edebc96e722b475e1a84a4240c5aa29be5d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E4=B8=AB=E8=AE=B2=E6=A2=B5?= Date: Thu, 4 Apr 2024 10:44:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4action=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E7=9A=84dist=20(#54)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dist-to-release.yml | 13 ++--- .github/workflows/docker-image.yml | 78 --------------------------- 2 files changed, 5 insertions(+), 86 deletions(-) delete mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/dist-to-release.yml b/.github/workflows/dist-to-release.yml index f452cdd..80dcc5c 100644 --- a/.github/workflows/dist-to-release.yml +++ b/.github/workflows/dist-to-release.yml @@ -24,19 +24,16 @@ jobs: - run: | sed -i 's@http://localhost:8888/@/@g' .env.production git config --global url."https://".insteadOf git:// - npm install --registry=http://registry.npmmirror.com + npm install yarn build:prod - run: | - mkdir go-ldap-admin-ui - mv README.md LICENSE default.conf go-ldap-admin-ui - mv dist go-ldap-admin-ui - tar zcvf go-ldap-admin-ui-${{ env.GITHUB_REF_NAME }}.tar.gz go-ldap-admin-ui - openssl md5 go-ldap-admin-ui-${{ env.GITHUB_REF_NAME }}.tar.gz > go-ldap-admin-ui-${{ env.GITHUB_REF_NAME }}.tar.gz.md5 + zip -q -r dist.zip dist + openssl md5 dist.zip > dist.zip.md5 - name: Upload release package uses: softprops/action-gh-release@v1 with: files: | - go-ldap-admin-ui-${{ env.GITHUB_REF_NAME }}.tar.gz - go-ldap-admin-ui-${{ env.GITHUB_REF_NAME }}.tar.gz.md5 \ No newline at end of file + dist.zip + dist.zip.md5 diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index 01a2e43..0000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,78 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: build docker image - -# Controls when the action will run. -on: - push: - branches: - - main - -# Allows you to run this workflow manually from the Actions tab - # 可以手动触发 - workflow_dispatch: - inputs: - logLevel: - description: 'Log level' - required: true - default: 'warning' - tags: - description: 'Test scenario tags' - -jobs: - buildx: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - - name: Get current date - id: date - run: echo "::set-output name=today::$(date +'%Y-%m-%d_%H-%M')" - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Available platforms - run: echo ${{ steps.buildx.outputs.platforms }} - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile - # 所需要的体系结构,可以在 Available platforms 步骤中获取所有的可用架构 - platforms: linux/amd64,linux/arm64/v8 - # 镜像推送时间 - push: ${{ github.event_name != 'pull_request' }} - # 给清单打上多个标签 - tags: | - eryajf/go-ldap-admin-ui:${{ steps.date.outputs.today }} - eryajf/go-ldap-admin-ui:latest - # 镜像推送到 阿里云仓库 - - name: Login to the Ali Registry - uses: docker/login-action@v2 - with: - registry: registry.cn-hangzhou.aliyuncs.com - username: ${{ secrets.ALIHUB_USERNAME }} - password: ${{ secrets.ALIHUB_TOKEN }} - - - name: Build and push to Ali - uses: docker/build-push-action@v3 - with: - context: . - push: true - platforms: linux/amd64,linux/arm64 - tags: | - registry.cn-hangzhou.aliyuncs.com/${{ secrets.ALIHUB_USERNAME }}/go-ldap-admin-ui:${{ steps.date.outputs.today }} - registry.cn-hangzhou.aliyuncs.com/${{ secrets.ALIHUB_USERNAME }}/go-ldap-admin-ui:latest \ No newline at end of file