Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To take a website screenshot automatically, put a Puppeteer script in your repository and schedule it with a GitHub Actions workflow. GitHub runs it from the latest commit on your default branch; the workflow checks out the code, installs Node dependencies and Chrome, captures the page, then saves or publishes the image.

What you need

  • A GitHub repository with a workflow file committed to its default branch. Scheduled workflows only trigger when the file is on that branch.
  • A Puppeteer project with a Node.js version compatible with the Puppeteer version you install. Puppeteer 25.12.0 documents Node 22.12 or newer; check the requirements for your installed release before choosing a runtime. See Puppeteer installation.
  • A destination for the screenshot. The example below uploads it as a workflow artifact, so it can be downloaded from the run rather than committed back into the repository.

1. Add a Puppeteer screenshot script

Install Puppeteer in the project and commit the generated package manifest and lockfile:

npm install puppeteer

Create scripts/screenshot.js:

const puppeteer = require('puppeteer');

async function main() {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    await page.setViewport({ width: 1440, height: 1000 });

    await page.goto('https://example.com', {
      waitUntil: 'networkidle2',
      timeout: 60000,
    });

    await page.screenshot({
      path: 'screenshot.png',
      fullPage: true,
    });
  } finally {
    await browser.close();
  }
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

Replace the example URL with the page you want to capture. Puppeteer runs headless by default, which is suitable for a non-interactive Actions runner. The screenshot guide shows page.screenshot() and also explains how to capture one element with ElementHandle.screenshot(): Puppeteer screenshots.

Choose when the page is ready

The example uses networkidle2, the condition shown in Puppeteer’s screenshot guide, but it is not right for every site. Some pages keep network connections open for analytics, live updates or chat; others render the content you need before network activity settles. Test the target page and choose a navigation condition that fits its behavior. For a page that needs a particular element, navigate and then wait for that selector before capturing it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

2. Define the scheduled workflow

Create .github/workflows/screenshot.yml and commit it to the repository’s default branch:

name: Scheduled website screenshot

on:
  schedule:
    # Every day at 14:23 UTC; avoid minute 0 to reduce contention.
    - cron: '23 14 * * *'
  workflow_dispatch:

permissions:
  contents: read

defaults:
  run:
    shell: bash

jobs:
  screenshot:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository
        uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '22'
          cache: npm

      - name: Install dependencies
        run: npm ci

      - name: Capture screenshot
        run: node scripts/screenshot.js

      - name: Upload screenshot
        uses: actions/upload-artifact@v4
        with:
          name: website-screenshot
          path: screenshot.png
          if-no-files-found: error

The action versions above are explicit examples; use the versions approved for your repository. Commit package-lock.json so npm ci installs the dependency tree from the lockfile. The manual-dispatch trigger lets you start a test run from the Actions tab without waiting for the cron schedule.

Set the cron time and timezone

GitHub schedule expressions use five-field POSIX cron syntax. The example runs daily at 14:23 UTC. Scheduled workflows use UTC by default, run against the latest commit on the default branch, and have a shortest interval of once every five minutes. GitHub also supports an IANA timezone setting for schedules; a named local timezone can follow daylight-saving changes, while UTC remains at a fixed offset throughout the year. Check GitHub’s syntax and timezone behavior before changing the schedule: GitHub workflow schedule events.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

GitHub does not guarantee that a scheduled run starts at its exact cron minute when Actions is busy. The start of an hour is a known high-load period, so scheduling at a minute other than 0 can reduce exposure to that congestion, but it cannot guarantee punctual execution.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Run it and retrieve the image

  1. Push the workflow and script to the default branch.
  2. In GitHub, open the repository’s Actions tab, select Scheduled website screenshot, then choose Run workflow to test it immediately.
  3. Open the completed run and download the website-screenshot artifact. The scheduled run will produce the same artifact when it executes.

Artifacts are convenient for review and short-term retrieval. If you need a persistent archive, publish the image to a storage service or another destination as an additional workflow step, using that destination’s credentials stored as GitHub Actions secrets. Avoid committing every generated image to the repository unless you specifically want versioned images there.

Browser installation and workflow compatibility

Puppeteer normally downloads a compatible Chrome for Testing browser during installation. If your package-manager policy blocks install scripts, that download may be skipped and the workflow can fail when Puppeteer tries to launch Chrome. Permit Puppeteer’s install script or add an explicit browser installation step:

Rank #3
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
npx puppeteer browsers install

Use a Node runtime compatible with the Puppeteer release actually installed. Puppeteer’s current documentation identifies version 25.12.0 and lists Node 22.12 or newer in its system requirements; dependency upgrades can change requirements. Review the release-specific guidance in the installation guide when updating.

Troubleshoot missed runs and failed captures

The scheduled workflow did not run

  • Check the branch: verify the workflow file exists on the repository’s default branch. A schedule does not trigger from a feature branch alone.
  • Check workflow status: inspect the Actions tab and confirm the workflow is enabled. GitHub automatically disables scheduled workflows in public repositories after 60 days without repository activity.
  • Allow for queue delays: scheduled jobs can be delayed during high Actions load, especially around the beginning of an hour; some queued jobs may be dropped. Choose a cron minute other than 0 and inspect run history rather than assuming the run starts exactly on time.
  • Confirm the expression: schedule syntax has five cron fields and uses UTC unless an IANA timezone is configured. Consult GitHub’s schedule documentation.

The job cannot launch Chrome

If the log reports that the browser executable is missing, check whether installation scripts were blocked. Allow Puppeteer’s install script or run npx puppeteer browsers install before the capture step. Also verify that the chosen Node version satisfies the installed Puppeteer release.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Navigation times out or the capture is incomplete

A timeout may mean the site is slow, inaccessible from the runner, or never reaches the selected readiness condition. Check the target URL and the failing run’s logs. Adjust the timeout when the site legitimately needs longer, or select a readiness condition suited to its loading behavior. If the page renders key content after navigation, wait for the relevant selector before taking the screenshot.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

The artifact is missing

Check whether the capture step completed successfully and wrote the expected path. The upload step uses if-no-files-found: error, which makes a missing screenshot.png visible as a failed workflow instead of silently producing an empty artifact.

For GitHub’s broader workflow troubleshooting guidance, see Troubleshooting workflows.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Timing, reliability and cost considerations

  • Timing: a five-minute interval is GitHub’s documented shortest schedule interval, not a guarantee of exact-time execution. If a capture must happen at a precise moment, account for queuing delays or use a system with timing guarantees suitable for that requirement.
  • Reliability: the schedule depends on the workflow remaining enabled, the repository’s default branch, successful dependency and browser setup, and the target site being reachable. The Actions run history provides the first place to diagnose a missed or failed capture.
  • Retention: the sample stores each image as an Actions artifact; choose an appropriate retention or external storage approach for your archive needs.
  • Usage: repeated schedules consume GitHub Actions usage. The workflow does not need a continuously running personal computer or server, but runner usage and any external storage may have separate account limits or costs.

Or skip the browser setup

If you want an API call instead of maintaining Puppeteer and Chrome in the workflow, ScreenshotNeo returns a screenshot or PDF from one GET request. Its screenshot API accepts a URL and offers clean captures that accept cookie or consent banners and remove 60+ known consent platforms, newsletter popups and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and response headers report the page verdict and billing status. It also provides an MCP server with screenshot tools for AI agents.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For example, add an API key as a GitHub Actions secret, then call the endpoint from a workflow step. See the ScreenshotNeo documentation for parameters and response details.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
curl -G "https://api.screenshotneo.com/v1/shot" 
  -d access_key=YOUR_API_KEY 
  --data-urlencode url=https://example.com 
  -o shot.webp

ScreenshotNeo includes 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000. To try it, sign up for ScreenshotNeo.

Frequently Asked Questions

Can I trigger the screenshot workflow manually?

Yes. The sample workflow includes workflow_dispatch; choose the workflow in the repository’s Actions tab and select Run workflow.

Can Puppeteer save a screenshot of just one element?

Yes. Puppeteer’s ElementHandle.screenshot() captures a selected element rather than the whole page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.