Capture website screenshots in your GitHub Actions workflow using GrabShot -- a fast, reliable screenshot API.
- name: Capture screenshot
uses: aitaskorchestra/grabshot-screenshot-action@v1
with:
url: 'https://example.com'
api-key: ${{ secrets.GRABSHOT_API_KEY }}
output: 'screenshots/homepage.png'- Sign up at grabshot.dev (free tier: 25 screenshots/month)
- Copy your API key from the dashboard
- Add it as a repository secret (
GRABSHOT_API_KEY)
| Input | Description | Required | Default |
|---|---|---|---|
url |
URL to screenshot | Yes | - |
api-key |
GrabShot API key | Yes | - |
output |
Output file path | No | screenshot.png |
width |
Viewport width | No | 1280 |
height |
Viewport height | No | 800 |
format |
Image format (png/jpeg/webp) | No | png |
full-page |
Capture full page | No | false |
delay |
Delay before capture (ms) | No | 0 |
| Output | Description |
|---|---|
file |
Path to the screenshot file |
size |
File size in bytes |
name: Visual Check
on: [pull_request]
jobs:
screenshot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Screenshot staging
uses: aitaskorchestra/grabshot-screenshot-action@v1
with:
url: 'https://staging.myapp.com'
api-key: ${{ secrets.GRABSHOT_API_KEY }}
output: 'screenshots/staging.png'
full-page: 'true'
- name: Upload screenshot
uses: actions/upload-artifact@v4
with:
name: screenshots
path: screenshots/name: Site Monitor
on:
schedule:
- cron: '0 */6 * * *'
jobs:
monitor:
runs-on: ubuntu-latest
steps:
- name: Check site
uses: aitaskorchestra/grabshot-screenshot-action@v1
with:
url: 'https://myapp.com'
api-key: ${{ secrets.GRABSHOT_API_KEY }}
output: 'check.png'MIT