test(gate): answer the one probe the recorded plan reads #294
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@93cb6efe18208431cddfb8368fd83d5badbf9bfd | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 | |
| 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: bash scripts/check-web-surface.sh docs | |
| - name: Deploy | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd | |
| 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 -qi '<main[ >]' /tmp/docs-index.html \ | |
| && grep -q 'href="/getting-started/"' /tmp/docs-index.html \ | |
| && curl -fsSL "$SITE_URL/getting-started/" -o /tmp/docs-getting-started.html \ | |
| && grep -qi '<main[ >]' /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 |