feat: 更新GitHub自动化构建配置 #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Readme | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
# 只在文件变更时触发 | |
# paths: | |
# - '**.xmind' | |
jobs: | |
bot: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [latest] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Node.js 版本:${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: pnpm | |
- name: 安装 pnpm | |
run: npm install pnpm -g | |
- name: 安装依赖 | |
run: pnpm install | |
- name: 打包 | |
run: pnpm run build | |
- name: 部署到 Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
repository-name: super456/FE-MindMap | |
clean: true | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
branch: action-pages | |
folder: dist | |
- name: 生成 README | |
run: pnpm greadme && pnpm prettier | |
- name: Push | |
uses: github-actions-x/[email protected] | |
with: | |
github-token: ${{ secrets.ACCESS_TOKEN }} | |
push-branch: main | |
commit-message: 'Update README.md by Github Actions' | |
name: github-actions[bot] |