-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (36 loc) · 1.13 KB
/
gifToWebp.yml
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
name: GIF to WebP Conversion
on:
push:
branches:
- main # or your default branch name
jobs:
convert-and-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y imagemagick
sudo apt-get install -y webp
curl -L https://github.com/ImageOptim/gifski/releases/download/1.11.0/gifski_1.11.0_amd64.deb -o gifski.deb
sudo dpkg -i gifski.deb
- name: Run conversion script
run: |
node gif-to-webp-converter.js
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git diff --quiet && git diff --staged --quiet || git commit -m "Convert GIF files to WebP"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}