From bc4a4436bcce82672dab2941d38099fa8d2a9ac0 Mon Sep 17 00:00:00 2001 From: Jacob Filik Date: Fri, 18 Oct 2024 13:36:29 +0100 Subject: [PATCH 1/2] get data repo location from env --- .github/workflows/node.js.yml | 4 +++- src/components/WelcomePage.tsx | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 9f582fc..b528241 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -32,7 +32,9 @@ jobs: - name: Install dependencies run: pnpm install - name: Run build - run: pnpm run build --base=/webxdiviewer/ + run: | + VITE_XDI_REPO_LOCATION=$DATA_REPO + pnpm run build --base=/webxdiviewer/ - name: Uploading production-ready build files uses: actions/upload-artifact@v4 with: diff --git a/src/components/WelcomePage.tsx b/src/components/WelcomePage.tsx index ce52971..032559a 100644 --- a/src/components/WelcomePage.tsx +++ b/src/components/WelcomePage.tsx @@ -1,7 +1,13 @@ import { Link } from "react-router-dom"; import { Container, Typography, Box } from "@mui/material"; +const env_repo_location = import.meta.env.VITE_SOME_KEY; + function WelcomePage() { + + const repo_location = env_repo_location ?? "examplerepo/xdifiles" + + console.log(repo_location) return ( @@ -16,9 +22,9 @@ function WelcomePage() { stored in a github repository. As part of the website build process, the XDI files are pulled in and indexed, giving simple static website to display open data. The website is currently pointing as a fork of - the data in the{" "} - - XASDataLibrary + the data in{" "} + + {repo_location} . From d41cdc18027f6f0a002d1b12a044cefaddbe82c6 Mon Sep 17 00:00:00 2001 From: Jacob Filik Date: Fri, 18 Oct 2024 13:47:05 +0100 Subject: [PATCH 2/2] adjust env setting --- .github/workflows/node.js.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index b528241..c19c26b 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -31,10 +31,10 @@ jobs: cache: "pnpm" - name: Install dependencies run: pnpm install + - name: Set env + run: echo "{VITE_XDI_REPO_LOCATION}={$DATA_REPO}" >> $GITHUB_ENV - name: Run build - run: | - VITE_XDI_REPO_LOCATION=$DATA_REPO - pnpm run build --base=/webxdiviewer/ + run: pnpm run build --base=/webxdiviewer/ - name: Uploading production-ready build files uses: actions/upload-artifact@v4 with: