Rename render.bash to use .sh extension
Some checks failed
/ build (push) Failing after 36s

Using .bash appears to have broken the call from Yarn in the CI?
This commit is contained in:
Michael Bradley 2025-02-19 18:39:23 -05:00
parent 6ae65fdb45
commit 66756b0605
Signed by: MichaelBradley
SSH key fingerprint: SHA256:cj/YZ5VT+QOKncqSkx+ibKTIn0Obg7OIzwzl9BL8EO8
2 changed files with 1 additions and 2 deletions

25
render.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace
yarn "build:targets"
PROD='dist/prod'
if [[ -d "$PROD" ]]; then
rm -r "$PROD"
fi
mkdir -p "$PROD"
echo 'Rendering webpage...'
node -e 'import("./dist/server/entry-server.js").then(({render}) => console.log(render().html))' > "$PROD"/index.html
echo "Preparing $PROD..."
# Copy used assets
cp -r dist/client/assets "$PROD"/
cp public/* "$PROD"/
# Not needed: Pre-rendered
rm "$PROD"/assets/*.js
# Not needed: Inlined
rm "$PROD"/assets/*.css