diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index aaacd432..064bcdca 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -71,22 +71,12 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: setup-java + - name: Setup Java uses: actions/setup-java@v4 with: java-version: 17 distribution: adopt - - name: Cache Gradle - uses: actions/cache@v3 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Gradle Wrapper Validation uses: gradle/wrapper-validation-action@v1 @@ -98,4 +88,38 @@ jobs: - name: Deploy uses: JamesIves/github-pages-deploy-action@v4 with: - folder: dokka/ \ No newline at end of file + folder: dokka/ + + demo: + name: "Publish Demo" + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + needs: release + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: adopt + + - name: Gradle Wrapper Validation + uses: gradle/wrapper-validation-action@v1 + + - name: Build Production browser demo + uses: gradle/gradle-build-action@v2 + with: + arguments: :demo:composeApp:jsBrowserProductionWebpack + + - name: Publish to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + projectName: kmpalette-demo + directory: demo/composeApp/build/dist/js/productionExecutable + gitHubToken: ${{ secrets.GITHUB_TOKEN }}