Files
FURK4NGG.github.io/.github/workflows/cache-build.yml
T
2025-03-05 00:58:30 +03:00

49 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: GitHub Pages Cache Build
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Cache Build Output
id: cache-build
uses: actions/cache@v4
with:
path: public
key: ${{ runner.os }}-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-
- name: Generate Version Map Automatically
run: |
echo "Generating version map..."
# Versiyon dosyası oluşturulacak
version_map="{}"
# Versiyonları dosya dosya hesaplayalım ve ekleyelim
for file in $(find . -type f); do
if [[ $file != *"node_modules"* && $file != *".github"* ]]; then
# Dosya için hash hesapla
hash=$(sha256sum "$file" | awk '{print $1}')
# version.json'a yeni hash değeri ekleyelim
version_map=$(echo $version_map | jq --arg file "$file" --arg hash "$hash" '. + {($file): $hash}')
fi
done
# Dosyayı yaz
echo $version_map > public/version.json
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public