震惊!逆天八百多行config.mts,拼尽全力无法战胜 #113
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 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@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: package.json | |
| check-latest: true | |
| #cache: yarn | |
| - name: Setup yarn | |
| run: | | |
| corepack enable | |
| yarn set version stable | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Get yarn cachedir | |
| id: yarn-cachedir | |
| run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
| - name: Cache yarn | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.yarn-cachedir.outputs.dir }} | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Cache Vitepress | |
| uses: actions/cache@v4 | |
| with: | |
| path: docs/.vitepress/cache | |
| key: ${{ runner.os }}-vitepress-${{ github.run_number }} | |
| restore-keys: | | |
| ${{ runner.os }}-vitepress- | |
| - name: Build with VitePress | |
| run: yarn run docs:build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/.vitepress/dist | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| needs: build | |
| runs-on: ubuntu-latest | |
| name: Deploy | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |