Files
web-imposter-game/.github/workflows/version-assets.yml
Dasemu e30aa089e4
Some checks failed
Build Android APK / build (push) Has been cancelled
Version Static Assets / version-assets (push) Has been cancelled
feat(versioning): update asset paths and versioning logic in HTML and scripts
2026-01-22 08:32:14 +01:00

54 lines
1.5 KiB
YAML

name: Version Static Assets
on:
push:
branches:
- main
paths:
- 'www/script.js'
- 'www/styles.css'
- 'www/logo.png'
- 'www/index.html'
- 'version-assets.sh'
- '.github/workflows/version-assets.yml'
jobs:
version-assets:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.APP_SECRET }}
fetch-depth: 0
- name: Delete old versioned assets
run: |
echo "🗑️ Borrando archivos hasheados antiguos..."
rm -f www/*.*.js www/*.*.css www/*.*.png || true
git add -A
- name: Run asset versioning
run: |
chmod +x version-assets.sh
./version-assets.sh
- name: Check for changes
id: check_changes
run: |
if git diff --quiet && git diff --cached --quiet; then
echo "changes=false" >> $GITHUB_OUTPUT
echo "No hay cambios para commitear"
else
echo "changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push versioned assets
if: steps.check_changes.outputs.changes == 'true'
run: |
git config --local user.email "ci@dariosevilla.es"
git config --local user.name "CI Action"
git add www/*.*.js www/*.*.css www/*.*.png www/index.html
git commit -m "chore: update asset versions [skip ci]"
git push