File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -54,10 +54,11 @@ jobs:
5454 uses : actions/cache@v3
5555 with :
5656 path : hugo-site/static/wasm
57- key : ${{ runner.os }}-wasm-${{ github.sha }}
57+ key : ${{ runner.os }}-wasm-${{ hashFiles('rust/gkwasm/**', 'rust/gklib/**') }}
5858
59- # Build WebAssembly
59+ # Build WebAssembly if cache miss or files changed
6060 - name : Build WebAssembly
61+ if : steps.cache-wasm.outputs.cache-hit != 'true'
6162 run : cargo make build-wasm-release
6263
6364 # Build the site using cargo-make
Original file line number Diff line number Diff line change @@ -25,8 +25,17 @@ dependencies = [
2525[tasks .build-site ]
2626description = " Build WebAssembly and Hugo site for deployment"
2727script = """
28- echo "Building WebAssembly files..."
29- cargo make build-wasm-release
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
3039cd hugo-site
3140hugo --minify
3241echo "Contents of public/wasm after running hugo:"
You can’t perform that action at this time.
0 commit comments