Merge pull request #2 from eSolia/feat/cf-workers-starlight-docs #1
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
| # Build and deploy the Marquis documentation site to Cloudflare Workers. | |
| name: Deploy Docs Site | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'docs-site/**' | |
| - 'mod.ts' | |
| - 'index.ts' | |
| - 'ui/**' | |
| - 'tokens/**' | |
| - 'utils/**' | |
| - '.github/workflows/docs-deploy.yml' | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: docs-deploy-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: '2.x' | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: docs-site/package-lock.json | |
| - name: Generate API reference (deno doc) | |
| run: deno task doc | |
| - name: Install docs-site dependencies | |
| working-directory: docs-site | |
| run: npm ci | |
| - name: Build Starlight site | |
| working-directory: docs-site | |
| run: npm run build | |
| - name: Deploy to Cloudflare Workers | |
| working-directory: docs-site | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| run: npx wrangler deploy |