Skip to content

Commit

Permalink
feat(gh-pages): 丰富pages站点的提交信息,实时同步next分支内容
Browse files Browse the repository at this point in the history
  • Loading branch information
chufan443 committed Oct 28, 2023
1 parent b5be536 commit 1c8f54c
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/CD.yaml
Expand Up @@ -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 }}

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1c8f54c

Please sign in to comment.