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
All checks were successful
Hugo Publish CI / build-and-deploy (push) Successful in 16s
This commit is contained in:
parent
8727ffa33f
commit
248138f653
@ -26,6 +26,12 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: hugo --minify
|
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
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v4
|
uses: peaceiris/actions-gh-pages@v4
|
||||||
with:
|
with:
|
||||||
|
Loading…
Reference in New Issue
Block a user