Skip to content

Commit

Permalink
feat: add WASM build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
BayernMuller committed Sep 21, 2024
1 parent cc742b5 commit 7bebbcf
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/wasm-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: WASM Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
wasm-build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ github.ref }}-
- name: Build Docker image for WASM
uses: docker/build-push-action@v4
with:
context: .
file: wasm/Dockerfile
tags: vibra-wasm:latest
push: false
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Run Docker container for WASM build
run: |
docker run --rm -v $(pwd)/wasm/build:/app/wasm/build vibra-wasm:latest
- name: Upload WASM artifacts
uses: actions/upload-artifact@v3
with:
name: wasm-build
path: |
wasm/build/vibra.wasm
wasm/build/vibra.js

0 comments on commit 7bebbcf

Please sign in to comment.