From 1c8f54cc34375792c63005d753ddadcb8603c8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=85=AC=E4=BC=97=E5=8F=B7=EF=BC=9A?= =?UTF-8?q?=E5=82=A8=E5=87=A1?= <77527113+chufan443@users.noreply.github.com> Date: Sun, 29 Oct 2023 00:09:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(gh-pages):=20=E4=B8=B0=E5=AF=8Cpages?= =?UTF-8?q?=E7=AB=99=E7=82=B9=E7=9A=84=E6=8F=90=E4=BA=A4=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=8C=E5=AE=9E=E6=97=B6=E5=90=8C=E6=AD=A5next=E5=88=86?= =?UTF-8?q?=E6=94=AF=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD.yaml | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CD.yaml b/.github/workflows/CD.yaml index 73c2891..3207d63 100644 --- a/.github/workflows/CD.yaml +++ b/.github/workflows/CD.yaml @@ -58,11 +58,29 @@ jobs: run: | ./scripts/bundle build_proxy + - name: Check GitHub Pages status + uses: crazy-max/ghaction-github-status@v3 + with: + pages_threshold: major_outage + + ## 获取Git提交信息 + - name: Get Commit Info + id: gitInfo + run: | + echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT + echo "author=$(git log -1 --pretty=%an)" >> $GITHUB_OUTPUT + echo "email=$(git log -1 --pretty=%ae)" >> $GITHUB_OUTPUT + + ## 参考:https://github.com/marketplace/actions/github-pages - name: Deploy To GitHub Page uses: crazy-max/ghaction-github-pages@v3 with: target_branch: pages/github build_dir: docs/.vuepress/dist + commit_message: chore(sync) v${{steps.gitInfo.outputs.version}} + committer: ${{steps.gitInfo.outputs.author}}<${{steps.gitInfo.outputs.email}}> + author: Mr·Sync + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -115,20 +133,21 @@ jobs: # 提取版本号 - name: Get New Version Number - id: extract_version - run: echo "::set-output name=version::$(node -p "require('./package.json').version")" + id: releaseVersion + run: | + echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT # 创建发布版本 - name: Create New Release - id: create_release + id: createRelease uses: actions/create-release@latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v${{ steps.extract_version.outputs.version }} - release_name: v${{ steps.extract_version.outputs.version }} + tag_name: v${{ steps.releaseVersion.outputs.version }} + release_name: v${{ steps.releaseVersion.outputs.version }} body: | - Release ${{ steps.extract_version.outputs.version }} + Release ${{ steps.releaseVersion.outputs.version }} ### Features @@ -140,7 +159,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} + upload_url: ${{ steps.createRelease.outputs.upload_url }} asset_path: ./408CSFamily.zip asset_name: 408CSFamily.zip asset_content_type: application/zip