2025-01-05 02:45:13 +01:00
|
|
|
name: Update Icons and Resources
|
2024-10-20 20:06:10 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- dev
|
|
|
|
paths:
|
|
|
|
- "svg/**"
|
2024-10-20 20:49:24 +02:00
|
|
|
- "png/**"
|
2024-10-20 20:06:10 +02:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
convert_assets:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
steps:
|
2025-01-05 02:45:13 +01:00
|
|
|
- name: Checkout Repository
|
2024-10-20 20:06:10 +02:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ github.ref_name }}
|
|
|
|
|
2025-01-05 02:45:13 +01:00
|
|
|
- name: Set Up Python
|
2024-10-20 20:06:10 +02:00
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.9"
|
|
|
|
|
2025-01-05 02:45:13 +01:00
|
|
|
- name: Install Dependencies
|
2024-10-20 20:06:10 +02:00
|
|
|
run: |
|
|
|
|
pip install cairosvg pillow
|
|
|
|
|
2025-01-05 02:45:13 +01:00
|
|
|
- name: Run SVG to PNG and WEBP Conversion
|
2024-10-20 20:06:10 +02:00
|
|
|
run: python scripts/convert_svg_assets.py
|
|
|
|
|
2025-01-05 02:45:13 +01:00
|
|
|
- name: Commit and Push Changes
|
2024-10-20 20:06:10 +02:00
|
|
|
run: |
|
2025-01-05 00:15:08 +01:00
|
|
|
git config --global user.email "homarr-labs@proton.me"
|
2024-10-20 20:06:10 +02:00
|
|
|
git config --global user.name "Dashboard Icons Bot"
|
|
|
|
git add png/ webp/
|
2025-01-05 02:45:13 +01:00
|
|
|
git commit -m "ci(github-actions): convert SVG assets to PNG and WEBP" || exit 0
|
2024-10-20 20:06:10 +02:00
|
|
|
git pull --rebase origin ${{ github.ref_name }}
|
|
|
|
git push origin HEAD:${{ github.ref_name }}
|
|
|
|
|
|
|
|
generate_file_tree:
|
|
|
|
needs: convert_assets
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
steps:
|
2025-01-05 02:45:13 +01:00
|
|
|
- name: Checkout Repository
|
2024-10-20 20:06:10 +02:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ github.ref_name }}
|
|
|
|
|
2025-01-05 02:45:13 +01:00
|
|
|
- name: Set Up Python
|
2024-10-20 20:06:10 +02:00
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.9"
|
|
|
|
|
2025-01-05 02:45:13 +01:00
|
|
|
- name: Generate File Tree
|
2024-10-20 20:10:17 +02:00
|
|
|
run: python scripts/generate_file_tree.py svg png webp
|
2024-10-20 20:06:10 +02:00
|
|
|
|
2025-01-05 02:45:13 +01:00
|
|
|
- name: Commit and Push Changes
|
2024-10-20 20:06:10 +02:00
|
|
|
run: |
|
2025-01-05 00:15:08 +01:00
|
|
|
git config --global user.email "homarr-labs@proton.me"
|
2024-10-20 20:06:10 +02:00
|
|
|
git config --global user.name "Dashboard Icons Bot"
|
2025-01-05 02:10:02 +01:00
|
|
|
git add tree.json tree.xml
|
2025-01-05 02:45:13 +01:00
|
|
|
git commit -m "ci(github-actions): generate file tree" || exit 0
|
2024-10-20 20:06:10 +02:00
|
|
|
git pull --rebase origin ${{ github.ref_name }}
|
|
|
|
git push origin HEAD:${{ github.ref_name }}
|
|
|
|
|
|
|
|
generate_icons_page:
|
|
|
|
needs: generate_file_tree
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
steps:
|
2025-01-05 02:45:13 +01:00
|
|
|
- name: Checkout Repository
|
2024-10-20 20:06:10 +02:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ github.ref_name }}
|
|
|
|
|
2025-01-05 02:45:13 +01:00
|
|
|
- name: Set Up Python
|
2024-10-20 20:06:10 +02:00
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.9"
|
|
|
|
|
2025-01-05 02:45:13 +01:00
|
|
|
- name: Generate ICONS.md
|
2024-10-20 20:06:10 +02:00
|
|
|
run: python scripts/generate_icons_page.py
|
|
|
|
|
2025-01-05 02:45:13 +01:00
|
|
|
- name: Commit and Push Changes
|
2024-10-20 20:06:10 +02:00
|
|
|
run: |
|
2025-01-05 00:15:08 +01:00
|
|
|
git config --global user.email "homarr-labs@proton.me"
|
2024-10-20 20:06:10 +02:00
|
|
|
git config --global user.name "Dashboard Icons Bot"
|
|
|
|
git add ICONS.md
|
2025-01-05 02:45:13 +01:00
|
|
|
git commit -m "ci(github-actions): generate ICONS.md" || exit 0
|
2024-10-20 20:06:10 +02:00
|
|
|
git pull --rebase origin ${{ github.ref_name }}
|
|
|
|
git push origin HEAD:${{ github.ref_name }}
|