ci: 更新 CI 工作流配置 #125
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: ci | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| cache: "yarn" | |
| - name: Install dependencies | |
| run: yarn --frozen-lockfile | |
| - name: Build frontend | |
| run: yarn build | |
| - name: Update Algolia Index | |
| env: | |
| HEXO_ALGOLIA_INDEXING_KEY: ${{ secrets.HEXO_ALGOLIA_INDEXING_KEY }} | |
| run: yarn algolia | |
| - name: Deploy to GitHub Pages | |
| uses: crazy-max/ghaction-github-pages@v5 | |
| with: | |
| target_branch: gh-pages | |
| build_dir: ./public | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |