fix: clean server.mjs comment (remove platform reference) #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy IsotopeAI | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "deploy" | |
| cancel-in-progress: true | |
| jobs: | |
| # ββ Build static site for GitHub Pages βββββββββββββββββββββββββββββββββββββ | |
| build-pages: | |
| name: Build GitHub Pages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Prepare static deploy folder | |
| run: | | |
| mkdir -p _site | |
| # Copy public/ contents (all assets, JS, CSS, fonts, icons, soundsβ¦) | |
| cp -r public/. _site/ | |
| # Copy index.html and rewrite all absolute root-relative paths to | |
| # relative paths so the app works under /isotope-code/ base path | |
| sed \ | |
| -e 's|href="/|href="./|g' \ | |
| -e 's|src="/|src="./|g' \ | |
| -e 's|url("/|url("./|g' \ | |
| -e 's|href="\.//|href="/|g' \ | |
| -e 's|src="\.//|src="/|g' \ | |
| index.html > _site/index.html | |
| # SPA fallback: GitHub Pages returns 404 for unknown paths. | |
| # Copy index.html as 404.html so the service worker can take over. | |
| cp _site/index.html _site/404.html | |
| # Suppress Jekyll processing | |
| touch _site/.nojekyll | |
| # Inject base path fix script so absolute asset fetches still resolve | |
| cat >> _site/index.html <<'BASEPATCH' | |
| <script> | |
| // GitHub Pages SPA path restore: ?p=/dashboard -> /dashboard | |
| (function(){ | |
| var q=location.search; | |
| if(q){var p=q.slice(1).replace(/~and~/g,'&'); | |
| history.replaceState(null,null,p+(location.hash||'')); | |
| } | |
| })(); | |
| </script> | |
| BASEPATCH | |
| # 404.html redirect to index.html preserving the path | |
| cat > _site/404.html <<'EOF' | |
| <!doctype html> | |
| <html><head> | |
| <meta charset="UTF-8"> | |
| <title>IsotopeAI</title> | |
| <script> | |
| // GitHub Pages SPA 404 trick: encode path into query string then redirect | |
| var l=window.location; | |
| l.replace(l.protocol+'//'+l.hostname+(l.port?':'+l.port:'')+ | |
| l.pathname.split('/').slice(0,2).join('/')+ | |
| '/?p='+l.pathname.slice(1)+ | |
| (l.search?'&'+l.search.slice(1):'')+ | |
| l.hash); | |
| </script> | |
| </head><body></body></html> | |
| EOF | |
| - name: Write version.json | |
| run: | | |
| VERSION=$(cat package.json | grep '"version"' | sed 's/.*"\([0-9.]*\)".*/\1/') | |
| DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
| SHA="${{ github.sha }}" | |
| cat > _site/version.json <<EOF | |
| { | |
| "version": "$VERSION", | |
| "sha": "${SHA:0:7}", | |
| "date": "$DATE", | |
| "repo": "Suydev/isotope-code", | |
| "releaseUrl": "https://github.com/Suydev/isotope-code/releases/latest" | |
| } | |
| EOF | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _site | |
| # ββ Deploy to GitHub Pages ββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| deploy-pages: | |
| name: Deploy to GitHub Pages | |
| needs: build-pages | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| steps: | |
| - name: Deploy | |
| id: deploy | |
| uses: actions/deploy-pages@v4 | |
| # ββ Create GitHub Release on version tag ββββββββββββββββββββββββββββββββββββ | |
| release: | |
| name: Create Release | |
| needs: deploy-pages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get version | |
| id: ver | |
| run: | | |
| VER=$(cat package.json | grep '"version"' | sed 's/.*"\([0-9.]*\)".*/\1/') | |
| echo "version=v$VER" >> $GITHUB_OUTPUT | |
| echo "bare=$VER" >> $GITHUB_OUTPUT | |
| - name: Check if release exists | |
| id: check | |
| run: | | |
| STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ | |
| -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
| "https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ steps.ver.outputs.version }}") | |
| echo "status=$STATUS" >> $GITHUB_OUTPUT | |
| - name: Create release zip | |
| if: steps.check.outputs.status == '404' | |
| run: | | |
| zip -r isotopeai-${{ steps.ver.outputs.bare }}.zip \ | |
| public/ index.html server.mjs package.json \ | |
| setup-linux.sh setup-termux.sh setup.bat setup-ios.sh \ | |
| README.md \ | |
| --exclude "*.git*" | |
| - name: Create GitHub Release | |
| if: steps.check.outputs.status == '404' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.ver.outputs.version }} | |
| name: "IsotopeAI ${{ steps.ver.outputs.version }}" | |
| body: | | |
| ## IsotopeAI ${{ steps.ver.outputs.version }} | |
| **Credits:** Arnav Singh (owner) Β· Suyash Prabh (developer) | |
| ### What's New | |
| - Full offline support β app works without server after first load | |
| - Light mode fully functional (removed dark-mode lock) | |
| - Background video now visible on dashboard | |
| - Complete CSS variable palette (light + dark) | |
| - Engagement layer: confetti, XP floats, progress animations, motivational toasts | |
| - Auto-update support in all platform installers | |
| ### Install | |
| | Platform | Command | | |
| |----------|---------| | |
| | Linux | `bash <(curl -fsSL https://raw.githubusercontent.com/Suydev/isotope-code/main/setup-linux.sh)` | | |
| | Android (Termux) | `bash <(curl -fsSL https://raw.githubusercontent.com/Suydev/isotope-code/main/setup-termux.sh)` | | |
| | Windows | Download `setup.bat` and double-click | | |
| | iOS (iSH) | `sh <(curl -fsSL https://raw.githubusercontent.com/Suydev/isotope-code/main/setup-ios.sh)` | | |
| ### Web (no install) | |
| [Open in browser β](https://suydev.github.io/isotope-code/) | |
| > The app works fully offline after first load via Service Worker PWA. | |
| files: isotopeai-${{ steps.ver.outputs.bare }}.zip | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| draft: false | |
| prerelease: false |