This commit is contained in:
BLUELOVETH 2023-07-06 13:30:20 +08:00
parent 350f2f40e9
commit 3699f39043
2 changed files with 42 additions and 0 deletions

35
.github/website.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: website
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
###################################################
- uses: actions/setup-node@v3.1.1
- name: Retype build
run: |
cd docs
npm install retypeapp --global
retype build
###################################################
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v12
with:
version: 3.1.25
actions-cache-folder: 'emsdk-cache'
- name: Compile
run: |
bash build_web.sh
mv web docs/.retype/static
###################################################
- uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: docs/.retype
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

7
build_web.sh Normal file
View File

@ -0,0 +1,7 @@
python3 prebuild.py
rm -rf web/lib
mkdir web/lib
SRC=$(find src/ -name "*.cpp")
em++ $SRC -Iinclude/ -fno-rtti -fexceptions -O3 -sEXPORTED_FUNCTIONS=_pkpy_new_repl,_pkpy_repl_input,_pkpy_new_vm -sEXPORTED_RUNTIME_METHODS=ccall -o web/lib/pocketpy.js