Skip to content
package

GitHub Action

Publish KMP Web App To GitHub Pages

v1.0.0 Latest version

Publish KMP Web App To GitHub Pages

package

Publish KMP Web App To GitHub Pages

Publish the web application on GitHub Pages

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Publish KMP Web App To GitHub Pages

uses: openMF/[email protected]

Learn more about this action in openMF/kmp-web-publish-action

Choose a version

Publish KMP Web App to GitHub Pages Action

Overview

This GitHub Action allows you to easily publish a Kotlin Multiplatform (KMP) Web Application to GitHub Pages with minimal configuration.

Features

  • Builds Kotlin/JS web application
  • Configures GitHub Pages
  • Uploads static files
  • Deploys to GitHub Pages
  • Provides deployment URL as output

Prerequisites

  • Kotlin Multiplatform Project
  • Gradle build system
  • GitHub Pages enabled in repository settings

Usage

  - name: Publish KMP Web App To GitHub Pages
    uses: openMF/[email protected]

Detailed Configuration

name: Deploy Web App

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions:
      pages: write
      id-token: write

    steps:
      - uses: actions/checkout@v4
      
      - name: Publish Web App
        uses: openMF/[email protected]
        with:
          web_package_name: 'your-web-module-name'

Inputs

web_package_name

  • Description: Name of the web package/module in your Kotlin Multiplatform project
  • Required: true
  • Type: string
  • Example: 'web', 'webApp'

Outputs

page_url

  • Description: URL of the deployed GitHub Pages site
  • Type: string
  • Example: https://yourusername.github.io/repository-name/

Permissions Required

permissions:
  pages: write      # Allows deployment to GitHub Pages
  id-token: write   # Enables secure token-based deployment

Troubleshooting

  • Ensure your Gradle build generates JS distribution in the expected path
  • Verify GitHub Pages is enabled in repository settings
  • Check Gradle build script for correct JS distribution task

Notes

  • Action uses jsBrowserDistribution Gradle task
  • Uploads files from build/dist/js/productionExecutable/
  • Supports single Kotlin Multiplatform Web module

Contributing

Contributions and improvements are welcome! Please open an issue or submit a pull request.