-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: ClaytonTDM <[email protected]>
- Loading branch information
1 parent
d087255
commit 976ebd1
Showing
1 changed file
with
54 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,54 @@ | ||
name: GIF to WebP Conversion | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # or your default branch name | ||
|
||
permissions: | ||
contents: write | ||
|
||
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: "20" | ||
|
||
- 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.32.0/gifski_1.32.0-1_amd64.deb -o gifski.deb | ||
sudo dpkg -i gifski.deb | ||
rm gifski.deb | ||
- name: Run conversion script | ||
run: | | ||
node .github/workflows/gif-to-webp-converter.js | ||
- name: Check for changes | ||
id: git-check | ||
run: | | ||
git add -A | ||
if git diff --staged --quiet; then | ||
echo "changes=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "changes=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Commit and push changes | ||
if: steps.git-check.outputs.changes == 'true' | ||
run: | | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git commit -m "Convert GIF files to WebP and remove original GIFs" | ||
git push | ||
#name: GIF to WebP Conversion | ||
# | ||
#on: | ||
# push: | ||
# branches: | ||
# - main # or your default branch name | ||
# | ||
#permissions: | ||
# contents: write | ||
# | ||
#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: "20" | ||
# | ||
# - 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.32.0/gifski_1.32.0-1_amd64.deb -o gifski.deb | ||
# sudo dpkg -i gifski.deb | ||
# rm gifski.deb | ||
# | ||
# - name: Run conversion script | ||
# run: | | ||
# node .github/workflows/gif-to-webp-converter.js | ||
# | ||
# - name: Check for changes | ||
# id: git-check | ||
# run: | | ||
# git add -A | ||
# if git diff --staged --quiet; then | ||
# echo "changes=false" >> $GITHUB_OUTPUT | ||
# else | ||
# echo "changes=true" >> $GITHUB_OUTPUT | ||
# fi | ||
# | ||
# - name: Commit and push changes | ||
# if: steps.git-check.outputs.changes == 'true' | ||
# run: | | ||
# git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
# git config --local user.name "github-actions[bot]" | ||
# git commit -m "Convert GIF files to WebP and remove original GIFs" | ||
# git push | ||
# |