Merge pull request #4 from SinclaM/csg #90
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 and Deploy to Github Pages | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ποΈ | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Install Zig π§ | |
uses: korandoru/setup-zig@v1 | |
with: | |
zig-version: master | |
- name: Install Emscripten π§ | |
run: | | |
curl -O https://codeload.github.com/emscripten-core/emsdk/tar.gz/refs/tags/3.1.51 | |
tar xzf 3.1.51 | |
cd emsdk-3.1.51 | |
./emsdk install latest | |
./emsdk activate latest | |
- name: Run tests π | |
run: zig build test | |
- name: Build ποΈ | |
run: zig build --sysroot emsdk-3.1.51/upstream/emscripten -Dtarget=wasm32-emscripten -Doptimize=ReleaseFast && sed -i'' -e 's/_emscripten_return_address,/() => {},/g' www/ray-tracer-challenge.js | |
- name: Deploy to GH Pages π | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: www | |