name: Deploy to GitHub Pages on: push: branches: - main workflow_dispatch: permissions: contents: read pages: write id-token: write concurrency: group: "pages" cancel-in-progress: false jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' - name: Install dependencies run: npm ci - name: Setup emsdk uses: mymindstorm/setup-emsdk@v14 with: version: 5.0.4 actions-cache-folder: 'emsdk-cache' # libFLAME + BLIS are built from source (WASM) via the sibling # concept-collection/libflame2wasm repo — nothing prebuilt is committed here. - name: Clone libflame2wasm (sibling) run: | git clone --depth 1 https://github.com/concept-collection/libflame2wasm.git "$GITHUB_WORKSPACE/../libflame2wasm" LIBFLAME_DIR="$(cd "$GITHUB_WORKSPACE/../libflame2wasm" && pwd)" echo "LIBFLAME_DIR=$LIBFLAME_DIR" >> "$GITHUB_ENV" echo "LIBFLAME_SHA=$(git -C "$LIBFLAME_DIR" rev-parse HEAD)" >> "$GITHUB_ENV" # Cache the four heavy libflame/BLIS static libraries, keyed on the # libflame2wasm commit + emsdk version. First build is slow (libflame is # compiled twice); afterwards this restores in seconds. - name: Cache libflame2wasm libraries id: libflame-cache uses: actions/cache@v4 with: path: | ${{ env.LIBFLAME_DIR }}/install/lib ${{ env.LIBFLAME_DIR }}/blis/lib/generic/libblis.a key: libflame2wasm-${{ env.LIBFLAME_SHA }}-emsdk5.0.4-v1 - name: Build libflame2wasm libraries if: steps.libflame-cache.outputs.cache-hit != 'true' run: bash "$LIBFLAME_DIR/build-all-wasm.sh" # Custom C kernels (wasm/dist/matmul.* + public/matmul/matmul_mt.*). - name: Build custom wasm kernels run: bash wasm/build-wasm.sh # libFLAME/BLIS matmul modules (public/matmul/matmul_blis_{st,mt}.*), # linked against the libraries built above. - name: Build BLIS wasm modules run: LIBFLAME="$LIBFLAME_DIR" bash blis/build-blis-wasm.sh - name: Build run: npm run build - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: ./dist deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4