chore: migrate astro configs (#1660) #14
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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| zizmor: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| security-events: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Run zizmor | |
| uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6 | |
| lint: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup | |
| - name: Lint | |
| run: pnpm run lint | |
| typecheck: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup | |
| - name: Typecheck | |
| run: pnpm run typecheck | |
| test: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shard: [1, 2, 3, 4, 5, 6, 7, 8] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup | |
| - name: Install Playwright | |
| run: pnpm run test:install | |
| - name: Run tests | |
| run: pnpm run test --shard=${{ matrix.shard }}/8 | |
| build: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup | |
| - uses: ./.github/actions/cache | |
| - name: Build packages | |
| run: pnpm run build:package | |
| - name: Build website | |
| run: pnpm run build | |
| publish-snapshot: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup | |
| - uses: ./.github/actions/cache | |
| - name: Build packages | |
| run: pnpm run build:package | |
| - name: Publish snapshot packages | |
| if: ${{ github.event_name == 'pull_request' }} | |
| run: | | |
| max_attempts=8 | |
| base_sleep=10 | |
| for attempt in $(seq 1 "${max_attempts}"); do | |
| echo "Attempt ${attempt} to publish snapshot packages..." | |
| if pnpm run ci:publish:snapshot; then | |
| echo "Publish snapshot packages succeeded" | |
| break | |
| elif [ "${attempt}" -eq "${max_attempts}" ]; then | |
| echo "Publish snapshot packages failed" | |
| exit 1 | |
| fi | |
| sleep_duration=$((base_sleep * attempt)) | |
| echo "Sleeping ${sleep_duration}s before retry..." | |
| sleep "${sleep_duration}" | |
| done | |
| linkcheck: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup | |
| - uses: ./.github/actions/cache | |
| - name: Build | |
| run: pnpm run build | |
| - name: Check links | |
| uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0 | |
| with: | |
| workingDirectory: website/dist | |
| args: > | |
| --include-fragments | |
| --index-files 'index.html' | |
| --root-dir "$PWD" | |
| --no-progress | |
| --format detailed | |
| --accept 100..=103,200..=299,403 | |
| --retry-wait-time 5 | |
| --max-retries 5 | |
| --exclude 'https://floating-ui.com' | |
| --remap "^https://prosekit\.dev\/components file://$(pwd)/components" | |
| --remap "^https://prosekit\.dev\/concepts file://$(pwd)/concepts" | |
| --remap "^https://prosekit\.dev\/extensions file://$(pwd)/extensions" | |
| --remap "^https://prosekit\.dev\/examples file://$(pwd)/examples" | |
| --remap "^https://prosekit\.dev\/frameworks file://$(pwd)/frameworks" | |
| --remap "^https://prosekit\.dev\/getting-started file://$(pwd)/getting-started" | |
| --remap "^https://prosekit\.dev\/guides file://$(pwd)/guides" | |
| --remap "^https://prosekit\.dev\/migrating-from file://$(pwd)/migrating-from" | |
| --remap "^https://prosekit\.dev\/references file://$(pwd)/references" | |
| './**/*.html' | |
| debug: false | |
| fail: true | |
| failIfEmpty: true | |
| deploy: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| permissions: | |
| contents: read | |
| deployments: write | |
| env: | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup | |
| - uses: ./.github/actions/cache | |
| - name: Build | |
| run: pnpm run build | |
| - name: Deploy to Cloudflare Pages | |
| uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4.0.0 | |
| if: ${{ env.CLOUDFLARE_ACCOUNT_ID != '' }} | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
| command: pages deploy website/dist --project-name=prosekit --branch="${{ github.head_ref || github.ref_name }}" | |
| timeout-minutes: 10 |