From 38f0c04b3e9422fbdaec06d0b00e8526815e4514 Mon Sep 17 00:00:00 2001 From: hermes-explorigin Date: Sun, 30 Aug 2026 19:01:13 +0000 Subject: [PATCH] Bake commit hash into build; log it via console.info on startup Build injects __WEATHER_COMMIT__ (VITE_COMMIT_HASH from CI's github.sha on branch builds, git rev-parse HEAD locally) and main.js logs console.info({ commit_hash }) so a deploy can be verified to match the commit that produced it. --- .gitea/workflows/deploy.yml | 4 ++++ dist/index.html | 3 +++ src/main.js | 3 +++ vite.config.js | 16 ++++++++++++++++ 4 files changed, 26 insertions(+) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 4f366d1..607dc95 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -27,6 +27,8 @@ jobs: run: npm run test:run - name: Build (single-file bundle) + env: + VITE_COMMIT_HASH: ${{ github.sha }} run: npm run build - name: Verify build output @@ -50,6 +52,8 @@ jobs: run: npm ci - name: Build (single-file bundle) + env: + VITE_COMMIT_HASH: ${{ github.sha }} run: npm run build - name: Verify build output diff --git a/dist/index.html b/dist/index.html index a4470c7..df8b7e2 100644 --- a/dist/index.html +++ b/dist/index.html @@ -8574,6 +8574,9 @@ delegate([ "touchstart", "touchend" ]); +//#endregion +//#region src/main.js +console.info({ commit_hash: "93e5660a5c76fd41088193f5ca3e3a35cd7478b1" }); mount(App, { target: document.getElementById("app") }); //#endregion