Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to vite app for settings server #69

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,45 @@ jobs:
source .venv/bin/activate
pytest

- name: Build web app
run: |
cd gonotego/settings-server
npm install
npm run build
cd ../..

- name: Archive web app build
uses: actions/upload-artifact@v4
with:
name: web-app-dist
path: gonotego/settings-server/dist

build_image:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download web app build
uses: actions/download-artifact@v4
with:
name: web-app-dist
path: web-app-dist

- uses: pguyot/arm-runner-action@v2
id: build_image
with:
base_image: https://downloads.raspberrypi.com/raspios_armhf/images/raspios_armhf-2024-03-15/2024-03-15-raspios-bookworm-armhf.img.xz
bootpartition: 1
rootpartition: 2
image_additional_mb: 4000
bind: |
${{ github.workspace }}/web-app-dist:/mnt/web-app-dist
commands: |
echo "Updating!"
sudo apt update

echo "Installing dependencies!"
sudo apt install -y git firefox-esr xvfb portaudio19-dev libatlas-base-dev redis-server espeak rustc python3-dev libopenblas-dev iptables iptables-persistent
sudo apt install -y git firefox-esr xvfb portaudio19-dev libatlas-base-dev redis-server espeak \
rustc python3-dev libopenblas-dev iptables iptables-persistent nodejs npm

echo "Installing Go Note Go!"
mkdir -p /home/pi/code/github/dbieber
Expand All @@ -54,6 +77,9 @@ jobs:
# Checkout the specific commit
git checkout $GITHUB_SHA

echo "Including web app"
cp -r /mnt/web-app-dist /home/pi/code/github/dbieber/GoNoteGo/gonotego/settings-server/dist

echo "Setting up Python environment"
python3 -m venv env
./env/bin/pip install -e . # Install Python dependencies
Expand Down
24 changes: 24 additions & 0 deletions gonotego/settings-server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
21 changes: 21 additions & 0 deletions gonotego/settings-server/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": false,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
28 changes: 28 additions & 0 deletions gonotego/settings-server/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
12 changes: 12 additions & 0 deletions gonotego/settings-server/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Go Note Go Settings</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading