-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (49 loc) · 1.43 KB
/
wasm-build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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):/app vibra-wasm:latest bash -c "cd wasm && ./build-wasm.sh"
- name: Upload WASM artifacts
uses: actions/upload-artifact@v3
with:
name: wasm-build
path: |
wasm/build/vibra.wasm
wasm/build/vibra.js