chore: migrate to Vite+ (#639) #589
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 chibivue Book to Pages | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check if it's the original repo and the main branch | |
| run: | | |
| if [[ "${{ github.repository }}" == "ubugeeei/chibivue" && "${{ github.ref }}" == "refs/heads/main" ]]; then | |
| echo "This is the original repo's main branch, running the workflow." | |
| else | |
| echo "This is a fork or a different branch, skipping the workflow." | |
| exit 0 | |
| fi | |
| - name: Setup Vite+ | |
| uses: voidzero-dev/setup-vp@v1 | |
| with: | |
| node-version: "24" | |
| cache: true | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Install dependencies | |
| run: vp install | |
| - name: Build with VitePress | |
| run: vp run book:build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: book/online-book/.vitepress/dist | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |