Skip to content

Capture Screenshot #100

Capture Screenshot

Capture Screenshot #100

Workflow file for this run

name: Capture Screenshot
on:
push:
branches:
- master
schedule:
- cron: '0 * * * *' # Runs every hour (optional)
jobs:
capture:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install Dependencies
run: |
npm install puppeteer
- name: Capture Screenshot
run: |
node capture-screenshot.js
env:
WEBSITE_URL: 'http://www.keays.xyz'
- name: Upload Screenshot
uses: actions/upload-artifact@v3
with:
name: screenshot
path: media/screenshot.png
- name: Set up Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "berlintay"
git config --global url."https://github.com/".insteadOf [email protected]:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKE }}
- name: Commit and Push Screenshot
run: |
git add media/screenshot.png
git commit -m "Update screenshot" || echo "No changes to commit"
git pull --rebase
git push
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKE }}