Skip to content

Commit eac9c87

Browse files
authored
Merge pull request #52 from DiamondLightSource/add-actions
Add deployment to Github Pages
2 parents 049e3cc + 7d24942 commit eac9c87

File tree

5 files changed

+65
-4
lines changed

5 files changed

+65
-4
lines changed

.github/workflows/actions.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy static content to Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["add-actions"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow one concurrent deployment
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: true
22+
23+
jobs:
24+
# Single deploy job since we're just deploying
25+
deploy:
26+
environment:
27+
name: github-pages
28+
url: ${{ steps.deployment.outputs.page_url }}
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
- name: Set up Node
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: 20
37+
cache: "npm"
38+
- name: Install dependencies
39+
run: npm ci
40+
- name: Build
41+
run: npm run build
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v4
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
# Upload dist folder
48+
path: "./dist"
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ dist-ssr
2323
*.njsproj
2424
*.sln
2525
*.sw?
26+
27+
# Build files
28+
*.tsbuildinfo

src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ function App() {
107107
]}
108108
>
109109
<FixedTargetPanels />
110-
<Footer logo={theme.logos.normal} color={theme.palette.primary.main}>
110+
<Footer color={theme.palette.primary.main}>
111+
{/* <Footer logo={theme.logos.normal} color={theme.palette.primary.main}> */}
111112
<FooterLinks>
112113
<ColourSchemeButton sx={{ marginLeft: "1px", marginTop: "2px" }} />
113114
</FooterLinks>

src/screens/DetectorMotion.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, Button, Stack, useTheme } from "@mui/material";
1+
import { Box, Button, Stack } from "@mui/material";
22
import { PvComponent, PvDescription, PvItem } from "../pv/PvComponent";
33
import { forceString } from "../pv/util";
44
import { submitAndRunPlanImmediately } from "../blueapi/blueapi";
@@ -19,7 +19,7 @@ function RoPvBox(props: PvDescription) {
1919
}
2020

2121
export function DetectorMotionTabPanel() {
22-
const _theme = useTheme();
22+
// const _theme = useTheme();
2323
return (
2424
<div>
2525
<Stack spacing={1}>

vite.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,11 @@ import react from "@vitejs/plugin-react-swc";
44
// https://vite.dev/config/
55
export default defineConfig({
66
plugins: [react()],
7-
define: { "process.env": { VITE_PVWS_SOCKET: "pvws.diamond.ac.uk", VITE_PVWS_SSL: "true" } },
7+
define: {
8+
"process.env": {
9+
VITE_PVWS_SOCKET: "pvws.diamond.ac.uk",
10+
VITE_PVWS_SSL: "true",
11+
},
12+
},
13+
base: "/mx-daq-ui/",
814
});

0 commit comments

Comments
 (0)