File tree Expand file tree Collapse file tree 1 file changed +34
-20
lines changed
Expand file tree Collapse file tree 1 file changed +34
-20
lines changed Original file line number Diff line number Diff line change 1- name : Build WebAssembly Hello World
1+ # .github/workflows/pages.yml
2+ name : Build & Deploy GitHub Pages (with WASM)
23
34on :
45 push :
5- branches : ["main"]
6- pull_request :
7- branches : ["main"]
6+ branches : [ main ]
7+ workflow_dispatch :
8+
9+ permissions :
10+ contents : read
11+ pages : write
12+ id-token : write
13+
14+ concurrency :
15+ group : " pages"
16+ cancel-in-progress : true
817
918jobs :
1019 build :
1120 runs-on : ubuntu-latest
12-
1321 steps :
14- - name : Check out repository
15- uses : actions/checkout@v4
22+ - uses : actions/checkout@v4
1623
17- - name : Set up Emscripten SDK
18- uses : mymindstorm/setup-emsdk@v12
24+ - uses : mymindstorm/setup-emsdk@v12
1925 with :
2026 version : 3.1.50
2127
22- - name : Compile C89 hello world to WebAssembly
28+ - name : Build wasm
2329 run : |
24- emcc \
25- -std=c89 \
26- -s STANDALONE_WASM=1 \
27- wasm/hello.c \
28- -o wasm/hello.wasm
29-
30- - name : Upload WebAssembly artifact
31- uses : actions/upload-artifact@v4
30+ emcc -std=c89 -s STANDALONE_WASM=1 wasm/hello.c -o wasm/hello.wasm
31+
32+ # If you use Jekyll, build here; otherwise just ship the repo contents.
33+ - name : Configure Pages
34+ uses : actions/configure-pages@v5
35+ - name : Upload site artifact
36+ uses : actions/upload-pages-artifact@v3
3237 with :
33- name : hello-wasm
34- path : wasm/hello.wasm
38+ path : . # ships your whole site, including wasm/hello.wasm
39+
40+ deploy :
41+ needs : build
42+ runs-on : ubuntu-latest
43+ environment :
44+ name : github-pages
45+ url : ${{ steps.deployment.outputs.page_url }}
46+ steps :
47+ - id : deployment
48+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments