Deploy JS App to GitHub Pages #1
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 JS App to GitHub Pages | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read # Required to fetch the repository content | |
| pages: write # Allow deployment to GitHub Pages | |
| id-token: write # Required by actions/configure-pages | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 1. Checkout the repository | |
| - name: "✅ Checkout code" | |
| uses: actions/checkout@v4 | |
| # 2. Set up JDK 21 | |
| - name: "⚙️ Set up JDK 21" | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| # 3. Set up Gradle | |
| - name: "⚙️ Setup Gradle" | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Create Sekrets | |
| run: | | |
| touch composeApp/sekret.properties | |
| ./gradlew composeApp:createSekretValue -Pkey=ADMOB_HOME_BANNER -Pvalue=${{ secrets.ADMOB_HOME_BANNER }} | |
| ./gradlew composeApp:createSekretValue -Pkey=ADMOB_VIDEO_REWARD -Pvalue=${{ secrets.ADMOB_VIDEO_REWARD }} | |
| ./gradlew composeApp:createSekretValue -Pkey=FIREBASE_WEB_ID -Pvalue=${{ secrets.FIREBASE_WEB_ID }} | |
| ./gradlew composeApp:createSekretValue -Pkey=FIREBASE_WEB_API_KEY -Pvalue=${{ secrets.FIREBASE_WEB_API_KEY }} | |
| - name: Create Google-Services | |
| env: | |
| GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES_BASE64 }} | |
| run: echo "${GOOGLE_SERVICES// /}" | base64 -d > composeApp/google-services.json | |
| - name: Generate Sekrets | |
| run: ./gradlew composeApp:generateSekret | |
| # 4. Build the WasmJS App | |
| - name: "🛠️ Build WasmJS App" | |
| run: gradle :composeApp:jsBrowserDistribution | |
| # 5. Set up GitHub Pages | |
| - name: "📄 Configure GitHub Pages" | |
| uses: actions/configure-pages@v5 | |
| # 6. Upload the built artifact to Pages | |
| - name: "📤 Upload GitHub Pages artifact" | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./composeApp/build/dist/js/productionExecutable | |
| # 7. Deploy to GitHub Pages | |
| - name: "🚀 Deploy to GitHub Pages" | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |