-
Notifications
You must be signed in to change notification settings - Fork 1
feat: wasmJs browser demo, Astro/Starlight docs site, and GitHub Pages CI/CD #3
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
48f4b70
docs: Add feature plan for stelekit-site
tstapler f8f4c77
feat: add wasmJs browser demo, Astro/Starlight docs site, and CI/CD p…
tstapler 646a8c5
feat: fix wasmJs toolchain resolution and add remaining implementatio…
tstapler c5142cd
docs: add SteleKit logo lockup to README
tstapler e516e5a
docs: add origin story, honest alternatives, and acknowledgements to …
tstapler 118b913
fix(ci): revert to PREFER_SETTINGS with explicit wasmJs toolchain Ivy…
tstapler 4fb03e6
chore: resolve merge conflict in settings.gradle.kts
tstapler 3867b15
fix: address PR review comments
tstapler 56e33e5
fix(ci): revert GraphManager Clock import to kotlin.time.Clock
tstapler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| name: Deploy to GitHub Pages | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
| actions: read | ||
|
|
||
| concurrency: | ||
| group: pages | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build-demo: | ||
| runs-on: ubuntu-latest | ||
| # Only rebuild Wasm when app code or build files change; site-only edits skip this job | ||
| if: | | ||
| github.event_name == 'workflow_dispatch' || | ||
| contains(toJSON(github.event.head_commit.modified), 'kmp/') || | ||
| contains(toJSON(github.event.head_commit.added), 'kmp/') || | ||
| contains(toJSON(github.event.head_commit.modified), 'gradle') || | ||
| contains(toJSON(github.event.head_commit.modified), 'settings.gradle') | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '21' | ||
| distribution: 'temurin' | ||
| - uses: gradle/actions/setup-gradle@v4 | ||
| with: | ||
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | ||
| - name: Build wasmJs demo | ||
| run: ./gradlew :kmp:wasmJsBrowserDistribution --no-daemon --build-cache -PenableJs=true | ||
| - name: Assert expected output exists | ||
| run: test -d kmp/build/dist/wasmJs/productionExecutable/ | ||
| - name: Assert no single file exceeds 90 MB | ||
| run: | | ||
| find kmp/build/dist/wasmJs/productionExecutable -type f -size +90M \ | ||
| -exec echo "FILE TOO LARGE: {}" \; | grep . && exit 1 || true | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: demo-dist | ||
| path: kmp/build/dist/wasmJs/productionExecutable/ | ||
| retention-days: 7 | ||
|
|
||
| build-site: | ||
| runs-on: ubuntu-latest | ||
| needs: build-demo | ||
| if: always() && (needs.build-demo.result == 'success' || needs.build-demo.result == 'skipped') | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| # Try current run first (when build-demo ran); fall back to last successful run | ||
| # so site-only edits keep the previously-built demo live. | ||
| - id: download-demo | ||
| name: Download demo artifact (current run) | ||
| uses: actions/download-artifact@v4 | ||
| continue-on-error: true | ||
| with: | ||
| name: demo-dist | ||
| path: site/public/demo/ | ||
| - id: download-demo-fallback | ||
| name: Download demo artifact (last successful run) | ||
| if: steps.download-demo.outcome == 'failure' | ||
| continue-on-error: true | ||
| run: | | ||
| LAST_RUN=$(gh run list --workflow pages.yml --status success --limit 1 \ | ||
| --json databaseId --jq '.[0].databaseId // empty') | ||
| if [ -n "$LAST_RUN" ]; then | ||
| gh run download "$LAST_RUN" --name demo-dist --dir site/public/demo/ | ||
| fi | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| - uses: actions/configure-pages@v5 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: npm | ||
| cache-dependency-path: site/package-lock.json | ||
| - run: npm ci | ||
| working-directory: site | ||
| - run: npm run build | ||
| working-directory: site | ||
| env: | ||
| DEMO_AVAILABLE: ${{ steps.download-demo.outcome == 'success' }} | ||
| - uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: site/dist/ | ||
|
|
||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| needs: build-site | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| steps: | ||
| - id: deployment | ||
| uses: actions/deploy-pages@v4 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.