ci: add wasm build and deploy #1
This file contains 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
name: Build | |
on: | |
push: | |
branches: | |
- main | |
- ci | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup zig | |
uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: 0.13.0-dev.274+c0da92f71 | |
# - name: Setup emsdk | |
# uses: mymindstorm/setup-emsdk@v14 | |
# with: | |
# version: 1.38.40 | |
# actions-cache-folder: 'emsdk-cache' | |
- name: Build and cache | |
run: zig build -Dtarget=wasm32-emscripten | |
- name: Move artifact | |
run: mv zig-out/web/wgui.html zig/out/index.html | |
- name: Publish on pages branch | |
run: | | |
sudo chown -R $(whoami):$(whoami) . | |
git config --global user.email "[email protected]" | |
git config --global user.name "$GITHUB_ACTOR" | |
git remote set-url origin "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" | |
ghp-import -f -p -n zig-out/web/ |