2024-10-20 19:37:43 +02:00
|
|
|
name: Convert SVG Assets ♻️
|
2024-10-20 19:29:39 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2024-10-20 19:34:53 +02:00
|
|
|
- dev
|
2024-10-20 19:29:39 +02:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
convert_assets:
|
|
|
|
runs-on: ubuntu-latest
|
2024-10-20 19:37:43 +02:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2024-10-20 19:29:39 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v3
|
2024-10-20 19:37:43 +02:00
|
|
|
with:
|
|
|
|
ref: ${{ github.ref_name }}
|
2024-10-20 19:29:39 +02:00
|
|
|
|
|
|
|
- name: Set Up Python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.9"
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
pip install cairosvg pillow
|
|
|
|
|
|
|
|
- name: Run SVG to PNG and WEBP Conversion
|
|
|
|
run: python scripts/convert_svg_assets.py
|
|
|
|
|
|
|
|
- name: Commit and Push Changes
|
|
|
|
run: |
|
|
|
|
git config --global user.email "noreply@lammers.media"
|
|
|
|
git config --global user.name "Dashboard Icons Bot"
|
|
|
|
git add png/ webp/
|
2024-10-20 19:37:43 +02:00
|
|
|
git commit -m ":recycle: Convert SVG assets to PNG and WEBP" || exit 0
|
|
|
|
git pull --rebase origin ${{ github.ref_name }}
|
|
|
|
git push origin HEAD:${{ github.ref_name }}
|