Skip to content

Commit d3bb281

Browse files
committed
add release version to document title
1 parent 9b66013 commit d3bb281

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
- name: Test
2323
run: dotnet run devopstests
2424

25+
- name: Set app version
26+
run: export APP_VERSION=${{ github.ref_name }}
27+
2528
- name: Build
2629
run: dotnet run bundle
2730

src/Client/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@
1414
var global = global || window;
1515
</script>
1616
<script type="module" src="/output/App.js"></script>
17+
<script type="module">
18+
document.title = document.title.concat(` - v${window.APP_VERSION}`)
19+
</script>
20+
1721
</body>
1822
</html>

src/Client/vite.config.mts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import react from "@vitejs/plugin-react";
33

44
const proxyPort = process.env.SERVER_PROXY_PORT || "5000";
55
const proxyTarget = "http://localhost:" + proxyPort;
6+
const appVersion = process.env.APP_VERSION || "dev"
67

78
// https://vitejs.dev/config/
89
export default defineConfig({
@@ -19,5 +20,8 @@ export default defineConfig({
1920
changeOrigin: true,
2021
}
2122
}
23+
},
24+
define: {
25+
APP_VERSION: JSON.stringify(appVersion),
2226
}
2327
});

0 commit comments

Comments
 (0)