-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y webp librsvg2-bin | ||
- name: Optimization | ||
run: | | ||
chmod +x optimize.sh | ||
./optimize.sh -i src/tracks -h 600 -q 100 -o out | ||
./optimize.sh -i src/artists -h 300 -q 100 -o out | ||
./optimize.sh -i src/playlists -h 300 -q 100 -o out | ||
- name: Deploy | ||
run: | | ||
sudo chown -R $(whoami):$(whoami) . | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "$GITHUB_ACTOR" | ||
cp -r out/* /tmp | ||
cd /tmp | ||
git init | ||
git branch -M gh-pages | ||
git add . | ||
git commit -m "Deploy to GitHub Pages" | ||
git remote add origin "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" | ||
git push -f origin gh-pages |