Skip to content

Screenshots in GitHub Actions

Capture deployment previews during pull request workflows and make visual changes available to reviewers.

Automated screenshots make visual changes available during pull request review. The Ironfang Render action captures preview URLs, adds results to the job summary and uploads the images as build artefacts.

Add Ironfang Render to your workflow

Add to any workflow that has a preview URL.

- uses: ironfang-ltd/render-action@v1
  with:
    api-key: ${{ secrets.IRONFANG_API_KEY }}
    urls: |
      https://preview.example.com/
      https://preview.example.com/pricing
    width: 1440
    full-page: true
    format: webp

The step adds a table to the job summary with each capture, its file size and its render time. It also uploads the images as build artefacts for review from the pull request.

Re-runs and the cache

Each capture counts once against the render.screenshot meter, and every account has a free allowance of screenshots each month. An identical request repeated within ten minutes may be served from cache and then counts nothing, but a cache hit is never guaranteed, so expect a re-run of the workflow to count its captures again.

Use cURL in other CI systems

Any CI runner with cURL can call the same endpoint, including GitLab CI and Jenkins.

curl -X POST https://api.ironfang.com/render/v1/screenshot \
  -H "Authorization: Bearer $IRONFANG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://preview.example.com", "width": 1440, "full_page": true}' \
  --output preview.png

Next