Update cache-build.yml

This commit is contained in:
FURK4NGG
2025-03-05 01:07:52 +03:00
committed by GitHub
parent c153758e95
commit 8a4f4a2f59
+35 -47
View File
@@ -1,48 +1,36 @@
name: GitHub Pages Cache Build - name: Update version.json
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: | run: |
echo "Generating version map..." echo '{
# Versiyon dosyası oluşturulacak "index.html": "v1",
version_map="{}" "home_en.html": "v2",
"home_tr.html": "v1",
# Versiyonları dosya dosya hesaplayalım ve ekleyelim "404.html": "v1",
for file in $(find . -type f); do "CSS/unpkg.comswiper@8swiper-bundle.min.css": "v1",
if [[ $file != *"node_modules"* && $file != *".github"* ]]; then "FONTS/Inconsolata.woff2": "v1",
# Dosya için hash hesapla "FONTS/Jaro.woff2": "v1",
hash=$(sha256sum "$file" | awk '{print $1}') "FONTS/Monomakh.woff2": "v1",
# version.json'a yeni hash değeri ekleyelim "FONTS/Montserrat.woff2": "v1",
version_map=$(echo $version_map | jq --arg file "$file" --arg hash "$hash" '. + {($file): $hash}') "FONTS/TacOne.woff2": "v1",
fi "FONTS/Teko.woff2": "v1",
done "JAVASCRIPT/1.js": "v3",
"JAVASCRIPT/tr/1.js": "v1",
# Dosyayı yaz "JAVASCRIPT/darkmode-js.min.js": "v1",
echo $version_map > public/version.json "JAVASCRIPT/gsap.min.js": "v1",
"JAVASCRIPT/swiper-bundle.min.js": "v1",
- name: Deploy to GitHub Pages "img/profile_photo1.webp": "v1",
uses: peaceiris/actions-gh-pages@v3 "img/character1.webp": "v2",
with: "img/character2.webp": "v1",
github_token: ${{ secrets.GITHUB_TOKEN }} "img/character3.webp": "v1",
publish_dir: ./public "img/ai.webp": "v1",
"img/app.webp": "v1",
"img/cyber.webp": "v1",
"img/game.webp": "v1",
"img/robotic.webp": "v1",
"img/web.webp": "v1",
"img/up.webp": "v1",
"img/icon.ico": "v1",
"sitemap.xml": "v1",
"manifest.json": "v1",
"robots.txt": "v1",
".htaccess.txt": "v1"
}' > public/version.json