Skip to content

Commit

Permalink
Optimize shots with oxipng
Browse files Browse the repository at this point in the history
Closes #1
  • Loading branch information
simonw committed May 19, 2022
1 parent 8f5e837 commit 5c717fb
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/shots.yml
Expand Up @@ -17,23 +17,27 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.10"
- uses: actions/cache@v2
- uses: actions/cache@v3
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache Playwright browsers
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright/
key: ${{ runner.os }}-browsers
- name: Cache OxiPNG
uses: actions/cache@v3
with:
path: ~/.cargo/
key: ${{ runner.os }}-cargo
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Install Playwright dependencies
run: |
cargo install oxipng
shot-scraper install
- uses: actions/github-script@v6
name: Create shots.yml if missing on first run
Expand All @@ -53,7 +57,11 @@ jobs:
- name: Take shots
run: |
shot-scraper multi shots.yml --retina
- name: Optimize PNGs
run: |-
oxipng -o 4 -i 0 --strip safe *.png
- name: Commit and push
if: github.ref == 'refs/heads/main'
run: |-
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
Expand Down

0 comments on commit 5c717fb

Please sign in to comment.