Skip to content

Merge pull request #164 from YoussefHachicha/issue-126-loop-not-smoot… #135

Merge pull request #164 from YoussefHachicha/issue-126-loop-not-smoot…

Merge pull request #164 from YoussefHachicha/issue-126-loop-not-smoot… #135

name: "Automatic Deployment of Dokka Docs and Compose Example"
on:
push:
branches:
- master
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Prevents simultaneous deployments
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# 1) Build Dokka Docs and the Compose Example
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java (Temurin 17)
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
# Generate Dokka Documentation
- name: Generate Dokka Docs
run: |
./gradlew dokkaHtml
# Build the Kotlin/Compose Example
- name: Build Kotlin/Compose Example
run: |
./gradlew :sample:composeApp:wasmJsBrowserDistribution
# Prepare a common structure for deployment
# Place the docs at the root and the example in /sample
- name: Prepare files for deployment
run: |
mkdir -p build/final
# Copy the docs into build/final (root of the site)
cp -r mediaplayer/build/dokka/html/* build/final
# Create the /sample folder in build/final
mkdir -p build/final/sample
cp -r sample/composeApp/build/dist/wasmJs/productionExecutable/* build/final/sample
# Upload to the "pages" artifact so it is available for the next job
- name: Upload artifact for GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: build/final
# 2) GitHub Pages Deployment
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
# The final URL will be provided in the page_url output
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
path: build/final