update footer to include hash
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Michael Zhang 2024-10-21 06:34:52 -05:00
parent ee867ae783
commit 2d0316adee
2 changed files with 14 additions and 5 deletions

View file

@ -1,6 +1,6 @@
steps: steps:
build: build:
image: git.mzhang.io/michael/blog-docker-builder:l3kh5sx46zqszsbr1ghvvdyp0zl8gl9m image: git.mzhang.io/michael/blog-docker-builder:j2ysg2m75s15il5wddnjbz3j36yy5fsa
environment: environment:
- ASTRO_TELEMETRY_DISABLED=1 - ASTRO_TELEMETRY_DISABLED=1
commands: commands:
@ -13,9 +13,10 @@ steps:
- event: push - event: push
deploy: deploy:
image: git.mzhang.io/michael/blog-docker-builder:l3kh5sx46zqszsbr1ghvvdyp0zl8gl9m image: git.mzhang.io/michael/blog-docker-builder:j2ysg2m75s15il5wddnjbz3j36yy5fsa
commands: commands:
- aws s3 sync ./dist/ s3://mzhang-io-website/ - mc alias set $AWS_DEFAULT_REGION $AWS_ENDPOINT_URL $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY --api S3v4
- mc mirror --overwrite ./dist/ $AWS_DEFAULT_REGION/mzhang-io-website/
secrets: secrets:
- AWS_ACCESS_KEY_ID - AWS_ACCESS_KEY_ID
- AWS_DEFAULT_REGION - AWS_DEFAULT_REGION

View file

@ -1,7 +1,10 @@
--- ---
import "../styles/footer.scss"; import "../styles/footer.scss";
import { execSync } from "node:child_process";
const dateUpdated = new Date(); const dateUpdated = new Date();
const gitRevShort = execSync("git rev-parse --short HEAD").toString().trim();
const gitRev = execSync("git rev-parse HEAD").toString().trim();
--- ---
<footer> <footer>
@ -12,8 +15,13 @@ const dateUpdated = new Date();
rel="noreferrer noopener">Astro</a rel="noreferrer noopener">Astro</a
> framework. > framework.
<br /> <br />
Last updated {dateUpdated.toLocaleString(undefined, { dateStyle: "full" })}. Last updated {dateUpdated.toLocaleString(undefined, { dateStyle: "full" })} at commit
<a
href={`https://git.mzhang.io/michael/blog/commit/${gitRev}`}
class="colorlink"
target="_blank">{gitRevShort}</a
>.
<br /> <br />
<a href="https://git.mzhang.io/michael/blog" class="colorlink" target="_blank">Source code</a> <a href="https://git.mzhang.io/michael/blog" class="colorlink" target="_blank">Source code</a>.
</p> </p>
</footer> </footer>