Skip to content

fix: tambah favicon.ico dari icon.png + referensi di index.html #21

fix: tambah favicon.ico dari icon.png + referensi di index.html

fix: tambah favicon.ico dari icon.png + referensi di index.html #21

Workflow file for this run

name: πŸš€ Deploy Voice Runner to Vercel
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
# Bisa juga trigger manual dari GitHub UI
workflow_dispatch:
jobs:
# ===== JOB 1: Cek kualitas kode =====
lint:
name: βœ… Quality Check
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout repository
uses: actions/checkout@v4
- name: πŸ” Check HTML validity
run: |
# Cek file-file penting ada
if [ ! -f "index.html" ]; then
echo "❌ index.html not found!"
exit 1
fi
if [ ! -d "js" ]; then
echo "❌ js/ directory not found!"
exit 1
fi
if [ ! -d "css" ]; then
echo "❌ css/ directory not found!"
exit 1
fi
echo "βœ… All required files exist"
- name: πŸ§ͺ Check JavaScript syntax
run: |
# Cek syntax JS files with node
for file in js/*.js; do
echo "Checking $file..."
node --check "$file" 2>&1 || {
echo "❌ Syntax error in $file"
exit 1
}
done
echo "βœ… All JavaScript files have valid syntax"
- name: πŸ“¦ Check file sizes (ZIP limit ~50MB)
run: |
total=0
echo "=== File sizes ==="
du -sh . --exclude=.git
echo "=================="
largest=$(find . -not -path './.git/*' -type f -exec du -b {} \; | sort -rn | head -5)
echo "Largest files:"
echo "$largest"
# ===== JOB 2: Build + Deploy ke Vercel =====
deploy:
name: 🌐 Deploy to Vercel
needs: lint
permissions:
contents: write # Diperlukan untuk push tag + buat release
# Hanya deploy dari push ke main/master, bukan dari PR
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout repository
uses: actions/checkout@v4
- name: πŸ“¦ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: ⚑ Install Vercel CLI
run: npm install --global vercel@latest
- name: πŸ”Œ Pull Vercel Environment Information
run: |
vercel pull \
--yes \
--environment=production \
--token=${{ secrets.VERCEL_TOKEN }} \
--scope=${{ secrets.VERCEL_ORG_ID || '' }}
- name: πŸ—οΈ Build Project Artifacts
run: |
vercel build \
--prod \
--token=${{ secrets.VERCEL_TOKEN }}
- name: πŸš€ Deploy to Vercel
run: |
vercel deploy \
--prebuilt \
--prod \
--token=${{ secrets.VERCEL_TOKEN }} \
--scope=${{ secrets.VERCEL_ORG_ID || '' }} \
2>&1 | tee deploy-output.txt
- name: 🌍 Get Deployment URL
id: deploy_url
run: |
echo "### βœ… Deployed to Vercel! πŸŽ‰" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Deployment URL:" >> $GITHUB_STEP_SUMMARY
grep -o 'https://[^ ]*\.vercel\.app' deploy-output.txt | head -1 | \
while read url; do
echo "- **Production**: [$url]($url)" >> $GITHUB_STEP_SUMMARY
echo "url=$url" >> $GITHUB_OUTPUT
done || echo "- Check Vercel dashboard for URL" >> $GITHUB_STEP_SUMMARY
- name: 🏷️ Buat Git Tag & Release
if: success()
id: create_release
run: |
# Generate version dari tanggal + commit
VERSION="v$(date +'%Y.%m.%d')-$(git rev-parse --short HEAD)"
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Buat tag
git tag $VERSION
git push origin $VERSION
echo "βœ… Tag created: $VERSION"
- name: πŸ“¦ Build ZIP (Itch.io ready)
if: success()
run: |
# Buat ZIP langsung di workspace root
ZIP_NAME="VoiceRunner-${{ steps.create_release.outputs.version }}.zip"
# File dan folder yang masuk ZIP (exclude .git, .github, dll)
zip -r "$ZIP_NAME" index.html js/ css/ Music/ assets/ vercel.json
# Info ukuran
echo "=== βœ… Build Artifact ==="
ls -lh "$ZIP_NAME"
echo "Total size:"
du -sh "$ZIP_NAME"
echo "======================"
- name: πŸ“¦ Publish GitHub Release
if: success()
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.create_release.outputs.version }}
name: "Voice Runner ${{ steps.create_release.outputs.version }}"
files: |
VoiceRunner-*.zip
body: |
## πŸš€ Voice Runner ${{ steps.create_release.outputs.version }}
**Commit:** ${{ github.event.head_commit.message || 'Manual trigger' }}
**🌐 Play Online:** ${{ steps.deploy_url.outputs.url || 'Vercel' }}
### βœ… Changes
${{ github.event.head_commit.message || 'β€”' }}
### πŸ“₯ Downloads
| Platform | File |
|----------|------|
| 🌐 Web | [Main](${{ steps.deploy_url.outputs.url || '#' }}) |
| πŸ“¦ Itch.io | ZIP game (lihat Assets bawah) |
---
*Auto-generated by GitHub Actions*
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: πŸ’¬ Send Telegram Notification (optional)
if: always()
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_CHAT_ID || '' }}
token: ${{ secrets.TELEGRAM_BOT_TOKEN || '' }}
message: |
Voice Runner ${{ job.status == 'success' && 'βœ…' || '❌' }} ${{ job.status == 'success' && 'Deployed!' || 'Deploy failed!' }}
${{ job.status == 'success' && format('Release: v{0}', steps.create_release.outputs.version) || '' }}
Commit: ${{ github.event.head_commit.message || 'Manual trigger' }}
format: markdown
disable_web_page_preview: true
continue-on-error: true