-
Notifications
You must be signed in to change notification settings - Fork 3
33 lines (30 loc) · 844 Bytes
/
main.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
name: deploy
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "**.css"
permissions:
contents: write
jobs:
minify-and-deploy:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
- run: |
find . -name "*.css" -not -path "./dist/*" | while IFS= read -r file; do
content=$(cat "$file")
result=$(curl -s -X POST --data-urlencode "input=$content" 'https://www.toptal.com/developers/cssminifier/api/raw')
dest_dir="dist/$(dirname "$file")"
mkdir -p "$dest_dir" && echo "$result" > "$dest_dir/$(basename "$file")"
done
shell: bash
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
branch: gh-pages
clean: true