Giter VIP home page Giter VIP logo

screenshot-website's Introduction

๐Ÿ“ธ screenshot-website

A GitHub Action to capture screenshots of a website, across Windows, Mac, and Linux

Contents

Usage

- 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/
  2. destination: Destination filename the captured website will be written to, defaults to screenshot.png

Optional inputs

Most of the options listed here (inputType, width, height, etc.) can be passed as inputs, just pass in a kebab-cased equivalent, e.g. full-page for fullPage:

- name: Screenshot Website
  uses: swinton/[email protected]
  with:
    source: https://github.com/swinton/screenshot-website
    destination: screenshot.png
    full-page: true

Outputs

An artifact 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.

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.

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

screenshot-website's People

Contributors

dependabot[bot] avatar swinton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

screenshot-website's Issues

Warning when using additional parameters

I'm using this action to create fullscreen screenshots of a website, that loads after some seconds. Therefore I use the delay and full-screen parameter. Since today (example run) there is a warning displayed (as annotation):

Unexpected input 'delay', valid inputs are ['source', 'destination']

I don't know if something changed at GitHub to now detect non-specified arguments.

Is there a way to get rid of the warning?

Process never completes

I'm not sure which of the new changes might have caused this, but as of the latest commit, when I try to run even the basic usage (one screenshot, one resolution, on ubuntu-latest) the action never completes. I don't get any error, it's just stuck on the screenshot step indefinitely -- I canceled it after 2 hours.

GitHub Action fails with OS variables

Running just the basic usage works.

When I tried using the first advanced usage example, with the different OSes, I got the following errors--

On Windows:
Error: Failed to launch the browser process! spawn C:\Program Files (x86)\Google\Chrome\Application\chrome.exe ENOENT

On Mac:
Error: The operation was canceled.

On Ubuntu:
Error: A task was canceled.

(To be clear, I didn't cancel those myself, and the error doesn't seem to provide any more info on why they were canceled.)

Incidentally, using the width variables with a single OS does work, although the width variable generates a warning. Attempting it with both width and OS variables (as in the second advanced usage example) fails on the same OS errors.

save file in repository

I can't find the way to save the screenshot as artifact AND in the repository. Is it possible ? Maybe it's a dumb question but my Action fails everytime I try to update my repo with a screenshot. Thanks !

Dynamic URLs from Netlify preview

Hi,

I wanted to ask if you know if it's possible to combine this action with the default Netlify setup.

Netlify hosts a preview of the current build, that's linked in every new PR. Now I want to have screenshots from this preview on multiple screen sizes. Do you know if that's possible?

Thanks,
Luka :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.