feat(classes-objects): 添加类和对象模块的基础实现 #6
This file contains hidden or 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: Deploy VitePress site to GitHub Pages | |
| on: | |
| # 在推送到 main 分支时触发 | |
| push: | |
| branches: [main] | |
| # 允许手动触发工作流 | |
| workflow_dispatch: | |
| # 设置权限 | |
| permissions: | |
| contents: read | |
| jobs: | |
| # 构建和部署工作 | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: docs/package-lock.json | |
| - name: Install dependencies | |
| run: | | |
| cd docs | |
| npm install | |
| - name: Build VitePress site | |
| run: | | |
| cd docs | |
| npm run build | |
| env: | |
| NODE_ENV: production | |
| - name: Deploy to target repository | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| # 使用个人访问令牌进行跨仓库部署 | |
| personal_token: ${{ secrets.PERSONAL_TOKEN }} | |
| # 目标仓库 | |
| external_repository: xiumubai/xiumubai.github.io | |
| # 发布目录 | |
| publish_dir: docs/.vitepress/dist | |
| # 目标分支 | |
| publish_branch: main | |
| # 目标目录 | |
| destination_dir: python-awesome-basic-coding | |
| # 提交信息 | |
| commit_message: 'Deploy python-awesome-basic-coding docs from ${{ github.sha }}' | |
| # 用户信息 | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' |