-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (61 loc) · 2.39 KB
/
Copy pathscreenshots.yml
File metadata and controls
65 lines (61 loc) · 2.39 KB
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
55
56
57
58
59
60
61
62
63
64
65
name: Take screenshots
on:
workflow_dispatch:
schedule:
- cron: "0 3 * * 1" # At 03:00 UTC on Monday: https://crontab.guru/#0_3_*_*_1
permissions:
contents: write
jobs:
take-shots:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache Oxipng
uses: actions/cache@v3
with:
path: ~/.cargo/
key: ${{ runner.os }}-cargo
- name: Install Oxipng if it is not installed
run: |
which oxipng || cargo install oxipng
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- uses: actions/cache@v3
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- name: Cache Playwright browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright/
key: ${{ runner.os }}-playwright
- name: Install dependencies
run: |
pip install shot-scraper
shot-scraper install
- name: Take shots
run: |
today=$(date +"%Y-%m-%d")
mkdir -p ./screenshots
shot-scraper https://hazadus.ru/ --width 1280 --wait 10000 -o "hazadus.ru.$today.png" || true
shot-scraper https://hazadus.ru/blogroll/ --width 1280 --wait 10000 -o "hazadus.ru-blogroll.$today.png" || true
shot-scraper http://hazadus.ru/microblog/ --width 1280 --wait 10000 -o "hazadus.ru-microblog.$today.png" || true
shot-scraper https://github.com/hazadus/ --width 1280 --wait 5000 -o "github-hazadus.$today.png" || true
shot-scraper https://steamcommunity.com/id/hazadus/ --width 1280 --wait 10000 -o "steam-profile.$today.png" || true
shot-scraper https://myshows.me/hazadus --width 1280 --wait 10000 --user-agent "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" -o "myshows.$today.png" || true
- name: Optimize PNGs
run: |-
oxipng -o 4 -i 0 --strip safe *.png && \
mv -f *.png ./screenshots/
- name: Commit and push
run: |-
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
git add -A
timestamp=$(date -u)
git commit -m "Скриншоты от ${timestamp}" || exit 0
git pull --rebase
git push