Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swinton/screenshot-website
:camera_flash: A GitHub Action to capture screenshots of a website, across Windows, Mac, and Linux
https://github.com/swinton/screenshot-website
actions github-actions screenshot website
Last synced: 15 days ago
JSON representation
:camera_flash: A GitHub Action to capture screenshots of a website, across Windows, Mac, and Linux
- Host: GitHub
- URL: https://github.com/swinton/screenshot-website
- Owner: swinton
- License: isc
- Created: 2020-03-06T19:53:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-24T11:07:50.000Z (5 months ago)
- Last Synced: 2024-10-23T01:16:40.548Z (22 days ago)
- Topics: actions, github-actions, screenshot, website
- Language: JavaScript
- Homepage: https://git.io/screenshot-website
- Size: 2.28 MB
- Stars: 188
- Watchers: 4
- Forks: 24
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# :camera_flash: `screenshot-website` ![](https://github.com/swinton/screenshot-website/workflows/Tests/badge.svg)
> A GitHub Action to capture screenshots of a website, across Windows, Mac, and Linux## Contents
- [Usage](#usage)
- [Inputs](#inputs)
- [Outputs](#outputs)
- [Advanced Usage](#advanced-usage)
- [Credits](#credits)## Usage
```yaml
- name: Screenshot Website
uses: swinton/[email protected]
with:
source: https://github.com/swinton/screenshot-website
destination: screenshot.png
```## Inputs
### Required inputs
1. `source`: Source of the content to be captured, may be a URL or HTML string, e.g. `https://example.com/`
1. `destination`: Destination filename the captured website will be written to, defaults to `screenshot.png`### Optional inputs
_Most_ of the options listed [here](https://github.com/sindresorhus/capture-website#options) (`inputType`, `width`, `height`, etc.) can be passed as inputs, just pass in a [kebab-cased](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles) equivalent, e.g. `full-page` for [`fullPage`](https://github.com/sindresorhus/capture-website#fullpage):
```yaml
- name: Screenshot Website
uses: swinton/[email protected]
with:
source: https://github.com/swinton/screenshot-website
destination: screenshot.png
full-page: true
```## Outputs
An [artifact](https://help.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts) will be created automatically for each screenshot captured. The following additional outputs are also supported:
1. `path`: The filesystem path to the captured screenshot
## Advanced Usage
Use a matrix to capture screenshots across different operating systems, e.g.
```yaml
jobs:
screenshot:
name: Screenshot
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}steps:
- name: Screenshot Website
uses: swinton/[email protected]
with:
source: https://github.com/swinton/screenshot-website
destination: screenshot-${{ matrix.os }}.png
```Combine a matrix with additional options such as width, e.g.
```yaml
jobs:
screenshot:
name: Screenshot
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
width: [1200, 992, 768, 600]
runs-on: ${{ matrix.os }}steps:
- name: Screenshot Website
uses: swinton/[email protected]
with:
source: https://github.com/swinton/screenshot-website
destination: screenshot-${{ matrix.os }}-${{ matrix.width }}.png
width: ${{ matrix.width }}
```## Credits
- :bow: https://github.com/sindresorhus/capture-website