Update index.html #837
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Take a Screenshot | ||
#on: | ||
# workflow_dispatch: | ||
inputs: | ||
Files: | ||
description: 'URL(s) or File(s) to take screenshot of (seperate by comma):' | ||
required: true | ||
default: "html/quote.html," | ||
Directory_To_Get_HTML_File: | ||
description: 'The directory name to save screenshots to (example : path/to/directory' | ||
required: False | ||
default: '' | ||
Directory_To_Save_HTML_File: | ||
description: 'URL or File' | ||
required: True | ||
default: 'File' | ||
schedule: | ||
# - cron: "0,* * * * *" # Schedule every 5 minutes | ||
- cron: "0 22,7 * * *" # Schedule on 12am of CET and PST. | ||
jobs: | ||
Screenshotter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out this repo | ||
uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: Installed package list | ||
run: apt list --installed | ||
- name: Remove Chrome | ||
run: sudo apt purge google-chrome-stable | ||
# Chromium is already installed! | ||
# - name: Install software | ||
# run: sudo apt install -y chromium-browser | ||
- name: Install all necessary packages | ||
### FOR VIDEO RECORDING | ||
# run: pip install chromedriver-autoinstaller selenium xvfbwrapper | ||
# - name: Install xvfb | ||
# run: sudo apt-get install xvfb ffmpeg | ||
### FOR SCREENSHOTS | ||
run: pip install chromedriver-autoinstaller selenium pyvirtualdisplay | ||
- name: Install xvfb | ||
run: sudo apt-get install xvfb | ||
- name: Run the scraping script | ||
working-directory: ./ | ||
run: | | ||
INPUT_STORE=${{ github.event.inputs.Files }} INPUT_STORE2=${{ github.event.inputs.Directory_To_Get_HTML_File }} INPUT_STORE3=${{ github.event.inputs.Directory_To_Save_HTML_File }} INPUT_STORE4=${{ github.event.repository.name }} python .github/screenshotter.py | ||
- name: Commit and Push | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git add -A | ||
git commit -m "Screenshot added" | ||
git push |