Skip to content

Add workflows to optimize PNG & SVG files - #9719

Draft
PikachuEXE wants to merge 7 commits into
FreeTubeApp:developmentfrom
PikachuEXE:dev/image-optimize-pr
Draft

Add workflows to optimize PNG & SVG files#9719
PikachuEXE wants to merge 7 commits into
FreeTubeApp:developmentfrom
PikachuEXE:dev/image-optimize-pr

Conversation

@PikachuEXE

Copy link
Copy Markdown
Member

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

Existing image compression workflow seems broken and thus removed in #9686

Description

Workflows for compressing images like what's done in #9685
One for image compression and PR opening, another for commenting on file size change summary

Screenshots

Testing

I run new workflow manually which opened PikachuEXE#90 (file details should be default close but I forgot to commit that change before running)
See workflow runs in

Desktop

  • OS:
  • OS Version:
  • FreeTube version:

Additional context

Some previous discussion in PikachuEXE#87
Using https://github.com/PikachuEXE/FreeTube/tree/dev/image-optimize to test workflow runs (files there slightly different from PR

@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) August 31, 2026 02:03
@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 31, 2026
@PikachuEXE
PikachuEXE marked this pull request as draft August 31, 2026 02:12
auto-merge was automatically disabled August 31, 2026 02:12

Pull request was converted to draft

@github-actions github-actions Bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 31, 2026
@PikachuEXE

Copy link
Copy Markdown
Member Author

File diff one failed due unable to fetch branch from origin, probably action issue so putting PR on draft until fixed/new action found

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed to see that this PR was opened

PikachuEXE#87 (comment)

Comment on lines +50 to +56
- name: Compress SVG Images
run: pnpm dlx svgo -r -f . -o .
shell: bash

- name: Compress PNG Images
run: oxipng -o max --strip safe --recursive ./_icons ./src
shell: bash

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc Sep 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Targeted dirs directly, remove recursive option as there isnt anything below those dirs. Let me know if you would prefer to include recursive anyway

Suggested change
- name: Compress SVG Images
run: pnpm dlx svgo -r -f . -o .
shell: bash
- name: Compress PNG Images
run: oxipng -o max --strip safe --recursive ./_icons ./src
shell: bash
- name: Compress SVG Images
run: |
pnpm dlx svgo -f ./_icons -o ./_icons
pnpm dlx svgo -f ./src/renderer/assets/img -o ./src/renderer/assets/img
shell: bash
- name: Compress PNG Images
run: oxipng -o max --strip safe ./_icons ./src/renderer/assets/img
shell: bash

Comment on lines +4 to +7
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per PikachuEXE#87 (comment)

Suggested change
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
on:
workflow_dispatch:
push:
branches: [development]
paths:
- '_icons/**'
- 'src/renderer/assets/img/**'

Comment on lines +13 to +16
# As this action runs on a schedule, only run it in the FreeTubeApp/FreeTube repository to avoid unnecessary GitHub Actions usage/billing in forks.
# Still allow the workflow to be manually triggered.
# If a fork does need this workflow, they can change this condition in their fork to include their repository.
if: github.repository == 'FreeTubeApp/FreeTube' || github.event_name == 'workflow_dispatch'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isnt needed anymore because there isnt a schedule

Suggested change
# As this action runs on a schedule, only run it in the FreeTubeApp/FreeTube repository to avoid unnecessary GitHub Actions usage/billing in forks.
# Still allow the workflow to be manually triggered.
# If a fork does need this workflow, they can change this condition in their fork to include their repository.
if: github.repository == 'FreeTubeApp/FreeTube' || github.event_name == 'workflow_dispatch'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants