feat: update for build chrome extension #19
Workflow file for this run
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: Cloudflare Preview Build | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| build-preview: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'doocs/md' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Set up node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build for Cloudflare Workers | |
| run: pnpm web build:h5-netlify | |
| env: | |
| CF_WORKERS: 1 | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cloudflare-dist | |
| path: apps/web/dist | |
| retention-days: 5 | |
| - name: Save PR number | |
| if: ${{ always() }} | |
| run: echo ${{ github.event.number }} > ./pr-id.txt | |
| - name: Upload PR number | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cloudflare-pr | |
| path: ./pr-id.txt |