Add commit hash to the page for better traceability and reference in the Hugo site.
All checks were successful
Hugo Publish CI / build-and-deploy (push) Successful in 16s

This commit is contained in:
Eric X. Liu 2024-09-16 13:06:55 -07:00
parent 8727ffa33f
commit 248138f653

View File

@ -26,6 +26,12 @@ jobs:
- name: Build
run: hugo --minify
- name: Replace [commit] with short commit hash and hyperlink
run: |
SHORT_COMMIT=$(git rev-parse --short HEAD)
COMMIT_URL="https://git.ericxliu.me/eric/ericxliu-me/commit/$SHORT_COMMIT"
find ./public -type f -exec sed -i "s|\[commit\]|<a href=\"$COMMIT_URL\">$SHORT_COMMIT</a>|g" {} +
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with: