Skip to content

Check images

Check images #23

Workflow file for this run

name: Check images
on:
workflow_dispatch:
schedule:
- cron: '0 17 * * 2' # 9AM PST (5PM UTC) on Tuesday mornings
env:
BOT_NAME: svc-docs-eng-opensource-bot
BOT_EMAIL: [email protected]
jobs:
check-images:
name: Convert or delete
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
ref: develop
persist-credentials: false
- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: 22.4
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Remove unused images
run: yarn remove-unused-images
- name: Convert images to WEBP
run: yarn convert-to-webp -g
id: convert-images
- name: Commit changes
id: commit-changes
if: steps.convert-images.outputs.convertedImages != 0
run: |
git config --local user.email "${{ env.BOT_EMAIL }}"
git config --local user.name "${{ env.BOT_NAME }}"
git add src/
git commit -m 'chore: remove unused images & convert to webp'
echo "commit=true" >> $GITHUB_OUTPUT
- name: Push Commit
if: steps.commit-changes.outputs.commit == 'true'
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.DOCS_ENG_BOT_TOKEN }}
branch: develop