Skip to content

Commit c48b6d9

Browse files
committed
build: fix access to build version env variable
1 parent f9a598d commit c48b6d9

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ jobs:
2121
- name: Install dependencies
2222
uses: bahmutov/npm-install@v1
2323

24+
- name: Get version from package.json
25+
id: version
26+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
27+
2428
- name: Build project
2529
env:
26-
GAME_BUILD_VERSION: v${{ steps.version.outputs.version }}+build.${{ github.run_number }}
30+
VITE_GAME_BUILD_VERSION: v${{ steps.version.outputs.version }}+build.${{ github.run_number }}
2731
run: |
2832
if [ "${{ github.ref }}" = "refs/heads/stable" ]; then
2933
npm run build # Production build for stable
@@ -66,6 +70,12 @@ jobs:
6670
- name: Checkout repo
6771
uses: actions/checkout@v4
6872

73+
- name: Download artifact
74+
uses: actions/download-artifact@v4
75+
with:
76+
name: build-files
77+
path: ./dist
78+
6979
- name: Get version from package.json
7080
id: version
7181
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT

src/common/components/root/root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function GameRoot() {
7878
const [currentPage, setCurrentPage] = useState("home");
7979
const game = useGame();
8080

81-
const gameBuildVersion = import.meta.env.GAME_BUILD_VERSION;
81+
const gameBuildVersion = import.meta.env.VITE_GAME_BUILD_VERSION;
8282

8383
const [openCategories, setOpenCategories] = React.useState<string[]>([]);
8484

0 commit comments

Comments
 (0)