Features Pricing Regions Support Start free Log in FR

Automate with GitHub Actions

Trigger a cache warm automatically after each deployment using GitHub Actions.

Run a boost after every production deploy so your cache is warm before users arrive.

Prerequisites

  • A boost already created via the API or dashboard
  • Your site ID and boost ID
  • An API key with boosts:write scope

Workflow

Add this workflow to .github/workflows/warm-cache.yml in your repository:

name: Warm cache

on:
  deployment_status:

jobs:
  warm:
    if: github.event.deployment_status.state == 'success'
    runs-on: ubuntu-latest
    steps:
      - name: Trigger CacheBoost run
        run: |
          curl -sf -X POST \
            https://api.cache-boost.com/v1/sites/${{ vars.CACHEBOOST_SITE_ID }}/boosts/${{ vars.CACHEBOOST_BOOST_ID }}/run \
            -H "Authorization: Bearer ${{ secrets.CACHEBOOST_API_KEY }}"

Configuration

Add the following to your repository:

NameWhereValue
CACHEBOOST_API_KEYSecretsYour API key (cb_live_...)
CACHEBOOST_SITE_IDVariablesYour site ID
CACHEBOOST_BOOST_IDVariablesYour boost ID

Go to Settings → Secrets and variables → Actions to add them.

Wait for the run to finish

If you want the workflow to wait until the run completes:

      - name: Wait for run
        run: |
          RUN_ID=$(curl -sf -X POST \
            https://api.cache-boost.com/v1/sites/${{ vars.CACHEBOOST_SITE_ID }}/boosts/${{ vars.CACHEBOOST_BOOST_ID }}/run \
            -H "Authorization: Bearer ${{ secrets.CACHEBOOST_API_KEY }}" \
            | jq -r '.id')

          for i in $(seq 1 30); do
            STATUS=$(curl -sf \
              https://api.cache-boost.com/v1/runs/$RUN_ID \
              -H "Authorization: Bearer ${{ secrets.CACHEBOOST_API_KEY }}" \
              | jq -r '.status')
            echo "Run status: $STATUS"
            [ "$STATUS" = "done" ] && exit 0
            [ "$STATUS" = "failed" ] && exit 1
            sleep 10
          done
          echo "Timed out waiting for run"
          exit 1

The poll loop above times out after 5 minutes (30 × 10s). Adjust seq 1 30 and sleep 10 to match your expected crawl duration.