-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (45 loc) · 1.28 KB
/
ss.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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 }}