-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.24 KB
/
convert-to-avif.yml
File metadata and controls
46 lines (37 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Convert Images to AVIF
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
convert:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install ImageMagick
run: sudo apt-get update && sudo apt-get install -y imagemagick
- name: Install GitHub CLI
run: sudo apt-get install -y gh
- name: Convert images to AVIF
run: |
find . -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" \) ! -path "./static/*" -exec sh -c '
for img; do
avif="${img%.*}.avif"
convert "$img" "$avif"
done
' sh {} +
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
branch: "convert-to-avif"
title: "Convert Images to AVIF"
body: |
This is an automated pull request that converts all the images to avifs along side the image, nothing should have been deleted, but new images should have been created.
commit-message: |
chore: convert images to AVIF
This is an automated commit created by github actions.