Improve web SEO #211
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 to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Set execution flag for gradlew | |
| run: chmod +x gradlew | |
| - name: Build WASM project | |
| run: ./gradlew :composeApp:wasmJsBrowserDistribution | |
| - name: Validate build before deploy | |
| run: | | |
| DIST=composeApp/build/dist/wasmJs/productionExecutable | |
| test -f "$DIST/index.html" || { echo "FATAL: index.html missing"; exit 1; } | |
| ls "$DIST"/*.wasm >/dev/null 2>&1 || { echo "FATAL: WASM bundle missing"; exit 1; } | |
| echo "All checks passed" | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: composeApp/build/dist/wasmJs/productionExecutable | |
| enable_jekyll: false |