fix: update assetKey for AI Assistant shader to correct file path #17
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 Flutter Web to GitHub Pages | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| # This workflow builds a Flutter web app with SPA routing support for GitHub Pages | |
| # It uses a custom 404.html file and redirect scripts to handle client-side routing | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.32.8' | |
| channel: 'stable' | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Copy shaders to assets | |
| run: dart scripts/copy_shaders.dart | |
| - name: Generate SEO files | |
| run: | | |
| dart scripts/generate_sitemap.dart | |
| - name: Build for GitHub Pages (with SPA routing) | |
| run: dart scripts/build_github_pages.dart --release | |
| - name: Verify SPA routing files | |
| run: | | |
| echo "π Verifying GitHub Pages SPA setup..." | |
| if [ -f "build/web/404.html" ]; then | |
| echo "β 404.html found" | |
| else | |
| echo "β 404.html missing" | |
| exit 1 | |
| fi | |
| if [ -f "build/web/.nojekyll" ]; then | |
| echo "β .nojekyll found" | |
| else | |
| echo "β .nojekyll missing" | |
| exit 1 | |
| fi | |
| if grep -q "/shaders_gallery/" build/web/index.html; then | |
| echo "β Base href correctly set" | |
| else | |
| echo "β Base href not found in index.html" | |
| exit 1 | |
| fi | |
| if [ -f "build/web/sitemap.xml" ]; then | |
| echo "β sitemap.xml found" | |
| else | |
| echo "β sitemap.xml missing" | |
| exit 1 | |
| fi | |
| if [ -f "build/web/robots.txt" ]; then | |
| echo "β robots.txt found" | |
| else | |
| echo "β robots.txt missing" | |
| exit 1 | |
| fi | |
| echo "π All SPA routing and SEO files verified!" | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./build/web | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |