Skip to content

Commit 8fad306

Browse files
committed
fix: Regenerate WebAssembly files on Rust file changes
1 parent 1595612 commit 8fad306

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,10 @@ jobs:
5454
uses: actions/cache@v3
5555
with:
5656
path: hugo-site/static/wasm
57-
key: ${{ runner.os }}-wasm-${{ hashFiles('rust/gkwasm/**', 'rust/gklib/**') }}
57+
key: ${{ runner.os }}-wasm-${{ github.sha }}
5858

59-
# Build WebAssembly if cache miss or files changed
59+
# Build WebAssembly
6060
- name: Build WebAssembly
61-
if: steps.cache-wasm.outputs.cache-hit != 'true' || hashFiles('rust/gkwasm/**', 'rust/gklib/**') != steps.cache-wasm.outputs.cache-primary-key
6261
run: cargo make build-wasm-release
6362

6463
# Build the site using cargo-make

Makefile.toml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,8 @@ dependencies = [
2525
[tasks.build-site]
2626
description = "Build WebAssembly and Hugo site for deployment"
2727
script = """
28-
if [ -n "$GITHUB_ACTIONS" ]; then
29-
if [ -d "hugo-site/static/wasm" ] && [ -n "$(ls -A hugo-site/static/wasm)" ]; then
30-
echo "Using cached WebAssembly files"
31-
else
32-
echo "WebAssembly files not found in cache, rebuilding..."
33-
cargo make build-wasm-release
34-
fi
35-
else
36-
echo "Building WebAssembly files..."
37-
cargo make build-wasm-release
38-
fi
28+
echo "Building WebAssembly files..."
29+
cargo make build-wasm-release
3930
cd hugo-site
4031
hugo --minify
4132
echo "Contents of public/wasm after running hugo:"

0 commit comments

Comments
 (0)