How I upload kaplay games from github to itch.io using github actions

I make games with kaplay.js and this is how I upload my games to itch.io. I do this so I don’t have to constantly zip and reupload files on the page whenever I make an update. The deployment type is webgl.

After you commit and push your game to github, you need to go to your itch.io account

While you’re still here over at itch.io

Next go to your github account and to the repo where you have your game

Then in your code editor when you’re making your game,

  name: Release


  on:
    push:
      branches:
        - main


  jobs:
    exports:
      name: Build, Release, and Upload
      runs-on: ubuntu-latest
      steps:
        - name: Check out repository
          uses: actions/checkout@v4

        - name: Setup Node.js
          uses: actions/setup-node@v4
          with:
            node-version: '20.x'

        - name: Install dependencies
          run: npm install

        - name: Build
          run: npm run build

        - name: Zip dist folder
          run: zip -r game.zip ./dist

        - uses: KikimoraGames/[email protected]
          with:
            butlerApiKey:  ${{secrets.BUTLER_API_KEY}} 
            gameData: ./game.zip
            itchUsername: 
            itchGameId: 
            buildChannel: webgl

Do not put any zip files in this repo or it won’t work.
Then commit and push everything to github. In a few mins your game should be published and working. Now everytime you make a change to the code, all you do is commit and push to github and it should update your itch.io page.

Credits to KikimoraGames for providing the github action. You can read more about it here