Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add publish step for demo #74

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}