更新交流群 #26
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 Vue to Pages | |
| on: | |
| push: | |
| branches: | |
| - main # 或者是你的主分支名 | |
| paths: | |
| - 'web/frontend/**' # 只有当这个目录下的文件变动时才触发 | |
| - '.github/workflows/deploy-web.yml' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| working-directory: web/frontend | |
| run: npm install | |
| - name: Build | |
| working-directory: web/frontend | |
| env: | |
| VITE_BASE_PATH: / | |
| run: npm run build | |
| - name: Deploy to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: web/frontend/dist # Vue build 生成的静态文件目录 | |
| branch: gh-pages # 部署到的目标分支 | |
| cname: codingsnake.seveoi.icu |