Skip to content

Update wikipedia rules #27

Update wikipedia rules

Update wikipedia rules #27

name: "minify-and-purge"
on:
push:
branches:
- 'core-0.3.x'
paths:
- '*.json'
- '!*.min.json'
jobs:
minify-and-purge:
name: "Minify And Purge"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout Repository"
uses: "actions/checkout@v4"
- name: "Install Dependencies"
run: |
python3 -m pip install -r ./.github/scripts/requirements.txt
- name: "Minify JSON Files"
run: |
python3 ./.github/scripts/minify-json.py
working-directory: ./
- name: "Detect Changes"
id: "detect-changes"
run: |
if git diff --staged --quiet; then
echo "changed=false" >> "$GITHUB_OUTPUT"
echo "No changes detected."
else
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "Changes detected."
fi
- name: "Commit"
if: ${{ steps.detect-changes.outputs.changed == 'true' }}
run: |
git config user.email "actions@github.com"
git config user.name "GitHub Actions"
git commit -m "Minify JSON files."
git push origin ${{ github.ref_name }}
echo "Changes committed."
- name: "Purge jsDelivr Cache"
if: ${{ steps.detect-changes.outputs.changed == 'true' }}
run: |
python3 ./.github/scripts/purge-jsdelivr.py
working-directory: ./