Skip to content

Initial commit

Initial commit #6

name: Optimize and Deploy
on:
push:
branches:
- main
jobs:
optimize:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y webp librsvg2-bin
- name: Optimization
run: |
./optimize.sh -h 40 -q 100 -o 40
./optimize.sh -h 300 -q 100 -o 600
- name: Deploy
run: |
sudo chown -R $(whoami):$(whoami) .
git config --global user.email "[email protected]"
git config --global user.name "$GITHUB_ACTOR"
cp -r 40 /tmp
cp -r 600 /tmp
cd /tmp
git init
git branch -M gh-pages
git add .
git commit -m "Optimize images"
git remote add origin "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY"
git push -f origin gh-pages