Skip to content

Commit

Permalink
CI: Add publish step for demo (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordond authored Dec 12, 2023
1 parent 46f3740 commit a4d91c1
Showing 1 changed file with 36 additions and 12 deletions.
48 changes: 36 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -98,4 +88,38 @@ jobs:
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dokka/
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 }}

0 comments on commit a4d91c1

Please sign in to comment.