Skip to content

Commit fedb96d

Browse files
authored
Add a deploy to gh pages (#193)
* Add a deploy to gh pages For every update to main * Update to have a publish branch * change base * Fix two places that weren't using base url
1 parent 498a2df commit fedb96d

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main # or master
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '20' # or your preferred Node.js version
19+
20+
- name: Install dependencies
21+
run: npm install
22+
23+
- name: Build package
24+
run: npm run build # Replace with your build command, outputting to e.g., 'dist'
25+
26+
- name: Deploy to GitHub Pages
27+
uses: peaceiris/actions-gh-pages@v4
28+
with:
29+
github_token: ${{ secrets.GITHUB_TOKEN }}
30+
publish_dir: ./dist # Directory containing your built output
31+
publish_branch: gh-pages

src/i18n/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ i18n
4747
interpolation: {
4848
escapeValue: false,
4949
},
50+
backend: {
51+
// Path to the translation files
52+
loadPath: import.meta.env.BASE_URL + "locales/{{lng}}/{{ns}}.json",
53+
},
5054
});
5155

5256
export default i18n;

src/reactComponents/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export default function Header(props: HeaderProps): React.JSX.Element {
8787
<img
8888
height={LOGO_HEIGHT}
8989
style={{objectFit: 'contain'}}
90-
src={isDarkTheme ? "/FIRST_HorzRGB_reverse.png" : "/FIRST_HorzRGB.png"}
90+
src={import.meta.env.BASE_URL + (isDarkTheme ? "/FIRST_HorzRGB_reverse.png" : "/FIRST_HorzRGB.png")}
9191
alt="FIRST Logo"
9292
/>
9393
<Antd.Typography

vite.config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import react from "@vitejs/plugin-react";
66
import tsconfigPaths from "vite-tsconfig-paths";
77

88
export default defineConfig({
9+
base: '/systemcore-blocks-interface/',
910
plugins: [react(), tsconfigPaths(), viteStaticCopy({
1011
targets: [
1112
{

0 commit comments

Comments
 (0)