From e9c9ad1f73c79b48dd81f55c179f93877e12ec27 Mon Sep 17 00:00:00 2001 From: Shubham Singh Date: Thu, 12 Dec 2024 11:22:25 +0530 Subject: [PATCH] Add website publishing GitHub workflow --- .github/workflows/publish.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..2e9aae7 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,37 @@ +name: Kotlin/WASM Build and Deploy + +on: + push: + branches: [main] + workflow_dispatch: # Allows manual triggering + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Java JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Setup Gradle and build project + uses: gradle/gradle-build-action@v3 + + - name: Grant Permission to Execute Gradle + run: chmod +x gradlew + + - name: Generate WASM distribution + run: ./gradlew wasmJsBrowserDistribution + + - name: Deploy to Vercel + uses: amondnet/vercel-action@v25 + with: + vercel-args: '--prod' + vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} + vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} + vercel-token: ${{ secrets.VERCEL_TOKEN }} + working-directory: ./build/dist/wasmJs/productionExecutable