name: Deploy Action WebRTC JS SDK

on:
    push:
        branches:
            - develop
jobs:
    publish-ubuntu-build:
        runs-on: ubuntu-latest
        steps:
            - name: Checkout repository
              uses: actions/checkout@master
            - name: Use Node.js
              uses: actions/setup-node@v2
              with:
                  node-version: 22
            - name: Build AWS SDK
              working-directory: ./aws-sdk-build
              run: |
                  npm install
                  npm run build
                  rm -rf ../examples/*-kvswebrtc.js
                  mv dist/*-kvswebrtc.js ../examples
            - name: Install dependencies
              run: npm install
            - name: Run release
              run: npm run release
            - name: Deploy to Github pages
              uses: JamesIves/github-pages-deploy-action@v4.2.5
              with:
                  folder: dist
                  branch: gh-pages
                  target-folder: develop
                  clean: true
