Skip to content

Commit e72f835

Browse files
committed
working on web demo
1 parent 26532d6 commit e72f835

2 files changed

Lines changed: 76 additions & 0 deletions

File tree

.github/workflows/carts.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
with:
2525
name: ${{ matrix.cart }}_c
2626
path: ${{ matrix.cart }}_c.null0
27+
2728
js:
2829
name: Build & Publish JS Carts
2930
runs-on: ubuntu-latest
@@ -42,6 +43,7 @@ jobs:
4243
with:
4344
name: ${{ matrix.cart }}_js
4445
path: ${{ matrix.cart }}_js.null0
46+
4547
as:
4648
name: Build & Publish Assemblyscript Carts
4749
runs-on: ubuntu-latest
@@ -59,6 +61,7 @@ jobs:
5961
with:
6062
name: ${{ matrix.cart }}_as
6163
path: ${{ matrix.cart }}_as.null0
64+
6265
nelua:
6366
name: Build & Publish Nelua Carts
6467
runs-on: ubuntu-latest
@@ -109,3 +112,34 @@ jobs:
109112
uses: softprops/action-gh-release@v2
110113
with:
111114
files: artifacts/**/*.null0
115+
116+
deploy-pages:
117+
name: Deploy to GitHub Pages
118+
runs-on: ubuntu-latest
119+
needs: [c, js, as, nelua]
120+
permissions:
121+
pages: write
122+
id-token: write
123+
environment:
124+
name: github-pages
125+
url: ${{ steps.deployment.outputs.page_url }}
126+
steps:
127+
- name: Checkout
128+
uses: actions/checkout@v4
129+
- name: Download all artifacts
130+
uses: actions/download-artifact@v4
131+
with:
132+
path: artifacts
133+
- name: Prepare Pages content
134+
run: |
135+
mkdir -p _site
136+
cp -r demo/* _site/
137+
cp -r artifacts/**/*.null0 _site/carts/
138+
ls _site/carts/*.null0 > _site/carts/carts.txt
139+
- name: Upload Pages artifact
140+
uses: actions/upload-pages-artifact@v3
141+
with:
142+
path: _site
143+
- name: Deploy to GitHub Pages
144+
id: deployment
145+
uses: actions/deploy-pages@v4

demo/index.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<html>
2+
<head>
3+
<title>Null0</title>
4+
<style>
5+
body {
6+
margin: 0;
7+
padding: 0;
8+
background: rgba(245, 245, 245, 255); /* RAYWHITE */
9+
background: black;
10+
display: flex;
11+
justify-content: center;
12+
align-items: center;
13+
min-height: 100vh;
14+
overflow: hidden;
15+
}
16+
17+
canvas {
18+
width: 100%;
19+
height: 100%;
20+
object-fit: contain;
21+
}
22+
</style>
23+
</head>
24+
<body>
25+
<p>Not ready yet!</p>
26+
</body>
27+
<script type="importmap">
28+
{
29+
"imports": {
30+
"@easywasm/wasi": "https://esm.sh/@easywasm/wasi",
31+
"fflate": "https://esm.sh/fflate/esm/browser.js"
32+
}
33+
}
34+
</script>
35+
<script type="module">
36+
// get list of carts
37+
const carts = await fetch("carts/carts/txt")
38+
.then((r) => r.text())
39+
.then((t) => t.trim().split("\n"));
40+
console.log(carts);
41+
</script>
42+
</html>

0 commit comments

Comments
 (0)