Skip to content

Commit

Permalink
env variable for version fix
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbryant committed Feb 26, 2024
1 parent 21532d6 commit a2ce9b0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Build
run: dotnet run bundle
env:
APP_VERSION: ${{ github.ref_name }}
VITE_APP_VERSION: ${{ github.ref_name }}

- name: Azure Login
uses: azure/login@v1
Expand Down
3 changes: 2 additions & 1 deletion src/Client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
</script>
<script type="module" src="/output/App.js"></script>
<script type="module">
document.title = document.title.concat(` - v${window.APP_VERSION}`)
const appVersion = import.meta.env.VITE_APP_VERSION || "dev"
document.title = document.title.concat(` - v${appVersion}`)
</script>

</body>
Expand Down
4 changes: 0 additions & 4 deletions src/Client/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import react from "@vitejs/plugin-react";

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

// https://vitejs.dev/config/
export default defineConfig({
Expand All @@ -20,8 +19,5 @@ export default defineConfig({
changeOrigin: true,
}
}
},
define: {
APP_VERSION: JSON.stringify(appVersion),
}
});

0 comments on commit a2ce9b0

Please sign in to comment.