Update cache-build.yml
This commit is contained in:
@@ -1,48 +1,36 @@
|
|||||||
name: GitHub Pages Cache Build
|
- name: Update version.json
|
||||||
|
run: |
|
||||||
on:
|
echo '{
|
||||||
push:
|
"index.html": "v1",
|
||||||
branches:
|
"home_en.html": "v2",
|
||||||
- main
|
"home_tr.html": "v1",
|
||||||
|
"404.html": "v1",
|
||||||
jobs:
|
"CSS/unpkg.comswiper@8swiper-bundle.min.css": "v1",
|
||||||
build:
|
"FONTS/Inconsolata.woff2": "v1",
|
||||||
runs-on: ubuntu-latest
|
"FONTS/Jaro.woff2": "v1",
|
||||||
|
"FONTS/Monomakh.woff2": "v1",
|
||||||
steps:
|
"FONTS/Montserrat.woff2": "v1",
|
||||||
- name: Checkout Repository
|
"FONTS/TacOne.woff2": "v1",
|
||||||
uses: actions/checkout@v4
|
"FONTS/Teko.woff2": "v1",
|
||||||
|
"JAVASCRIPT/1.js": "v3",
|
||||||
- name: Cache Build Output
|
"JAVASCRIPT/tr/1.js": "v1",
|
||||||
id: cache-build
|
"JAVASCRIPT/darkmode-js.min.js": "v1",
|
||||||
uses: actions/cache@v4
|
"JAVASCRIPT/gsap.min.js": "v1",
|
||||||
with:
|
"JAVASCRIPT/swiper-bundle.min.js": "v1",
|
||||||
path: public
|
"img/profile_photo1.webp": "v1",
|
||||||
key: ${{ runner.os }}-build-${{ github.sha }}
|
"img/character1.webp": "v2",
|
||||||
restore-keys: |
|
"img/character2.webp": "v1",
|
||||||
${{ runner.os }}-build-
|
"img/character3.webp": "v1",
|
||||||
|
"img/ai.webp": "v1",
|
||||||
- name: Generate Version Map Automatically
|
"img/app.webp": "v1",
|
||||||
run: |
|
"img/cyber.webp": "v1",
|
||||||
echo "Generating version map..."
|
"img/game.webp": "v1",
|
||||||
# Versiyon dosyası oluşturulacak
|
"img/robotic.webp": "v1",
|
||||||
version_map="{}"
|
"img/web.webp": "v1",
|
||||||
|
"img/up.webp": "v1",
|
||||||
# Versiyonları dosya dosya hesaplayalım ve ekleyelim
|
"img/icon.ico": "v1",
|
||||||
for file in $(find . -type f); do
|
"sitemap.xml": "v1",
|
||||||
if [[ $file != *"node_modules"* && $file != *".github"* ]]; then
|
"manifest.json": "v1",
|
||||||
# Dosya için hash hesapla
|
"robots.txt": "v1",
|
||||||
hash=$(sha256sum "$file" | awk '{print $1}')
|
".htaccess.txt": "v1"
|
||||||
# version.json'a yeni hash değeri ekleyelim
|
}' > public/version.json
|
||||||
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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user