Build Spigot/CraftBukkit #134
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: Build Spigot/CraftBukkit | |
| on: | |
| schedule: | |
| # Run every 6 hours - builds take ~5 min each, so this allows gradual building | |
| - cron: "0 */6 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Specific version to build (e.g., 1.21.4). Leave empty to build all missing." | |
| required: false | |
| type: string | |
| env: | |
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
| SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} | |
| API_URL: https://api.mcserverjars.com | |
| jobs: | |
| build-spigot: | |
| name: Build Spigot/CraftBukkit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| working-directory: ./indexers | |
| - name: Build Spigot/CraftBukkit | |
| run: | | |
| if [ -n "${{ github.event.inputs.version }}" ]; then | |
| echo "Building specific version: ${{ github.event.inputs.version }}" | |
| bun run index-spigot.ts ${{ github.event.inputs.version }} | |
| else | |
| echo "Building all missing versions (one at a time)" | |
| bun run index-spigot.ts | |
| fi | |
| working-directory: ./indexers | |
| # Allow up to 6 hours for builds (each takes ~5 min) | |
| timeout-minutes: 360 | |
| revalidate-pages: | |
| name: Trigger Revalidation | |
| runs-on: ubuntu-latest | |
| needs: [build-spigot] | |
| if: always() | |
| steps: | |
| - name: Trigger revalidation | |
| run: | | |
| curl -X POST "${{ secrets.REVALIDATION_URL }}" \ | |
| -H "Authorization: Bearer ${{ secrets.REVALIDATION_SECRET }}" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"paths": ["/", "/spigot", "/craftbukkit"]}' | |
| continue-on-error: true | |