Skip to content

Refactor module loading in index.html: remove cache-busting logic for… #72

Refactor module loading in index.html: remove cache-busting logic for…

Refactor module loading in index.html: remove cache-busting logic for… #72

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- main
- dev
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
path: main-content
- name: Checkout dev branch
uses: actions/checkout@v4
with:
ref: dev
path: dev-content
- name: Get latest release version
id: get_release
run: |
RELEASE_TAG=$(curl -s https://api.github.com/repos/MrAlders0n/MeshCore-GOME-WarDriver/releases/latest | jq -r '.tag_name')
echo "version=$RELEASE_TAG" >> $GITHUB_OUTPUT
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Prepare combined deployment
env:
RELEASE_VERSION: ${{ steps.get_release. outputs.version }}
run: |
mkdir -p _site
cp -r main-content/* _site/ 2>/dev/null || true
# Inject version into main branch
sed -i 's|MeshCore Wardrive</h1>|MeshCore Wardrive <span class="text-sm text-slate-400">'"${RELEASE_VERSION}"'</span></h1>|' _site/index.html
mkdir -p _site/dev
cp -r dev-content/* _site/dev/ 2>/dev/null || true
# Inject dev badge with date
DEV_DATE=$(date -u +"%Y-%m-%d %H:%M UTC")
sed -i 's|MeshCore Wardrive</h1>|MeshCore Wardrive <span class="ml-2 px-2 py-0.5 text-xs font-semibold rounded bg-amber-600/20 text-amber-400 border border-amber-600/40">DEV</span> <span class="text-xs text-slate-500">'"${DEV_DATE}"'</span></h1>|' _site/dev/index.html
find _site -name ". git" -exec rm -rf {} + 2>/dev/null || true
find _site -name ".github" -exec rm -rf {} + 2>/dev/null || true
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Comment deployment URL
run: |
echo "✅ Deployed successfully!"
echo "📦 Main branch (${{ steps.get_release.outputs.version }}): https://mralders0n.github.io/MeshCore-GOME-WarDriver/"
echo "🔧 Dev branch: https://mralders0n.github.io/MeshCore-GOME-WarDriver/dev/"