Minify #52
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
name: Minify | |
on: | |
push: | |
branches: [main] | |
paths: | |
- "list/*" | |
- "scripts/*" | |
- ".github/workflows/minify.yml" | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
psl: | |
name: PSL | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- run: mkdir -p list | |
- name: Download public_suffix_list.dat | |
run: curl -o list/public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat | |
- name: Minify public_suffix_list.dat | |
run: | | |
OUTPUT=$(node scripts/minify.js) | |
echo "${OUTPUT}" | |
echo "minify_percent=${OUTPUT}" >> $GITHUB_ENV | |
- name: Commit | |
env: | |
MINIFY_PERCENT: ${{ env.minify_percent }} | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
git add list/public_suffix_list.min.dat | |
git commit --allow-empty -m "chore: minify PSL (saved ${MINIFY_PERCENT})" | |
git push | |
- name: Trigger Coolify Webhook | |
run: | | |
curl -X POST "${{ secrets.WEBHOOK_URL }}" -H "Authorization: Bearer ${{ secrets.COOLIFY_API_KEY }}" |