test: lock macos package binary cohort #62
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: Publish Docs | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Build docs | |
| permissions: | |
| contents: read | |
| deployments: write | |
| env: | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v5 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| cache-dependency-path: docs/pnpm-lock.yaml | |
| - name: Install | |
| run: cd docs && pnpm install --frozen-lockfile | |
| - name: Build | |
| run: cd docs && pnpm run build | |
| - name: Deploy | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| uses: cloudflare/wrangler-action@v3 | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy docs/dist/ --project-name=capsem-docs | |
| - name: Smoke public docs site | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| env: | |
| SITE_URL: https://docs.capsem.org | |
| run: | | |
| for attempt in 1 2 3 4 5 6; do | |
| echo "Checking $SITE_URL (attempt $attempt)..." | |
| if curl -fsSLI "$SITE_URL/" -o /tmp/docs-headers.txt \ | |
| && grep -qi '^content-type: text/html' /tmp/docs-headers.txt \ | |
| && curl -fsSL "$SITE_URL/" -o /tmp/docs-index.html \ | |
| && grep -q "The fastest way to ship with AI securely." /tmp/docs-index.html \ | |
| && curl -fsSL "$SITE_URL/getting-started/" -o /tmp/docs-getting-started.html \ | |
| && grep -q "Getting Started" /tmp/docs-getting-started.html | |
| then | |
| echo "docs.capsem.org smoke passed." | |
| exit 0 | |
| fi | |
| sleep 10 | |
| done | |
| echo "docs.capsem.org smoke failed after deploy." >&2 | |
| exit 1 |