Update cache-build.yml
This commit is contained in:
@@ -1,48 +1,36 @@
|
||||
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
|
||||
- name: Update version.json
|
||||
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
|
||||
echo '{
|
||||
"index.html": "v1",
|
||||
"home_en.html": "v2",
|
||||
"home_tr.html": "v1",
|
||||
"404.html": "v1",
|
||||
"CSS/unpkg.comswiper@8swiper-bundle.min.css": "v1",
|
||||
"FONTS/Inconsolata.woff2": "v1",
|
||||
"FONTS/Jaro.woff2": "v1",
|
||||
"FONTS/Monomakh.woff2": "v1",
|
||||
"FONTS/Montserrat.woff2": "v1",
|
||||
"FONTS/TacOne.woff2": "v1",
|
||||
"FONTS/Teko.woff2": "v1",
|
||||
"JAVASCRIPT/1.js": "v3",
|
||||
"JAVASCRIPT/tr/1.js": "v1",
|
||||
"JAVASCRIPT/darkmode-js.min.js": "v1",
|
||||
"JAVASCRIPT/gsap.min.js": "v1",
|
||||
"JAVASCRIPT/swiper-bundle.min.js": "v1",
|
||||
"img/profile_photo1.webp": "v1",
|
||||
"img/character1.webp": "v2",
|
||||
"img/character2.webp": "v1",
|
||||
"img/character3.webp": "v1",
|
||||
"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
|
||||
|
||||
Reference in New Issue
Block a user