fix: use npm (not npx) as wrangler packageManager — npx is not a vali… #34
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 Docs | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'website/**' | |
| - '.github/workflows/deploy-docs.yml' | |
| tags-ignore: | |
| - '**' | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: pages-${{ github.event_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| package_json_file: website/package.json | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| cache-dependency-path: website/pnpm-lock.yaml | |
| - name: Install dependencies | |
| working-directory: website | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| working-directory: website | |
| run: pnpm run build | |
| - name: Deploy preview | |
| if: github.event_name == 'push' | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| packageManager: npm | |
| command: pages deploy website/out --project-name=harness-kit-docs --branch=preview | |
| - name: Deploy production | |
| if: github.event_name == 'release' | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| packageManager: npm | |
| command: pages deploy website/out --project-name=harness-kit-docs --branch=main |