docs: update #105
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: main | |
| on: | |
| push: | |
| branches: | |
| - master | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check_changes: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| docs_changed: ${{ steps.filter.outputs.docs }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| base: ${{ github.ref_name }} | |
| filters: | | |
| docs: | |
| - 'docs/**' | |
| build-docs: | |
| needs: check_changes | |
| runs-on: ubuntu-24.04 | |
| if: ${{ needs.check_changes.outputs.docs_changed == 'true' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: | | |
| cd $GITHUB_WORKSPACE/docs | |
| pnpm i --frozen-lockfile | |
| - name: Build | |
| run: | | |
| cd $GITHUB_WORKSPACE/docs | |
| npm run build | |
| cp $GITHUB_WORKSPACE/scripts/www/* $GITHUB_WORKSPACE/docs/doc_build/ | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs | |
| retention-days: 1 | |
| path: docs/doc_build | |
| deploy-docs-cloudflare: | |
| needs: build-docs | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Download | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: docs | |
| path: docs | |
| - name: Deploy Cloudflare Pages | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} | |
| run: npx wrangler@3 pages deploy docs --project-name=${{ vars.CF_PAGE_NAME }} | |
| deploy-docs-eo: | |
| needs: build-docs | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Download | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: docs | |
| path: docs | |
| - name: Deploy EdgeOne Pages | |
| run: npx edgeone pages deploy $GITHUB_WORKSPACE/docs -n ${{ vars.EO_PAGE_NAME }} -t ${{ secrets.EO_PAGE_TOKEN }} |