Update deploy workflow

This commit is contained in:
Borys Levytskyi
2025-11-11 09:44:31 -05:00
parent 8751fbaeda
commit 975f987d76

View File

@@ -4,7 +4,7 @@ on:
workflow_dispatch:
jobs:
preview-gh-pages:
deploy-to-production:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
@@ -27,6 +27,11 @@ jobs:
CI: true
run: npm run build
- name: Run unit tests
env:
CI: true
run: npm test -- --watchAll=false
- name: Embed commit hash in index.html
run: |
commit_hash=$(git rev-parse HEAD)
@@ -35,7 +40,7 @@ jobs:
echo "Expected $index_path to exist after build" >&2
exit 1
fi
printf '<!-- Commit: %s -->\n' "$commit_hash" | cat - "$index_path" > "${index_path}.with-hash"
printf '<!-- Howdy! So you like looking at other people\'s html sources, huh? I do it too. Anyway, the commit hash is %s -->\n' "$commit_hash" | cat - "$index_path" > "${index_path}.with-hash"
mv "${index_path}.with-hash" "$index_path"
echo "commit_hash=$commit_hash" >> "$GITHUB_ENV"