Skip to content

Commit dd34a34

Browse files
committed
doc: add website live example
1 parent 8e575e7 commit dd34a34

37 files changed

Lines changed: 1603 additions & 19 deletions

.github/workflows/pages.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
name: Build Web Site
13+
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master'
14+
runs-on: ubuntu-22.04
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
steps:
18+
- uses: actions/checkout@v5
19+
with:
20+
submodules: recursive
21+
fetch-depth: 0
22+
23+
- name: Build Soluna (WASM)
24+
uses: ./.github/actions/soluna
25+
id: build
26+
with:
27+
soluna_path: "."
28+
29+
- name: Install web build tools
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y lua5.4 zip
33+
34+
- name: Prepare web assets
35+
run: |
36+
lua5.4 script/build_web.lua \
37+
--soluna . \
38+
--site web \
39+
--wasm "${{ steps.build.outputs.SOLUNA_WASM_PATH }}" \
40+
--js "${{ steps.build.outputs.SOLUNA_JS_PATH }}"
41+
42+
- name: Setup Hugo
43+
uses: peaceiris/actions-hugo@v3
44+
with:
45+
hugo-version: "0.119.0"
46+
47+
- name: Build
48+
run: hugo --source web --minify
49+
50+
- name: Upload static files as artifact
51+
id: deployment
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: web/public
55+
56+
deploy:
57+
name: Deploy to GitHub Pages
58+
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master'
59+
needs: [build]
60+
runs-on: ubuntu-22.04
61+
permissions:
62+
pages: write
63+
id-token: write
64+
environment:
65+
name: github-pages
66+
url: ${{ steps.deployment.outputs.page_url }}
67+
steps:
68+
- name: Deploy to GitHub Pages
69+
id: deployment
70+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ bin/macos
55
bin/mingw
66
bin/msvc
77
bin/emcc
8+
web/public
9+
web/data
10+
web/static/runtime
11+
web/static/data

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Sokol + Lua = Soluna
88

99
[中文](./README.zh-CN.md)
1010

11+
[Live Examples](https://cloudwu.github.io/soluna/)
12+
1113
A framework you can use to make 2D games in Lua with multithreading, living on Windows, Linux, macOS and modern Browsers (via WebAssembly).
1214

1315
It is built on top of [sokol](https://github.com/floooh/sokol) and leverages the power of ltask for multithreading.

README.zh-CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Sokol + Lua = Soluna
88

99
[English](./README.md)
1010

11+
[在线演示](https://cloudwu.github.io/soluna/)
12+
1113
一个基于 [sokol](https://github.com/floooh/sokol) 的 2D 游戏引擎。它以 Lua 为编程语言,整合了 ltask 作为多线程框架。sokol + lua 是其名字的由来。
1214

1315
Soluna 可以运行在 Windows、Linux、macOS 和现代浏览器(通过 WebAssembly)上。

0 commit comments

Comments
 (0)