Skip to content

Commit a03fc75

Browse files
committed
Created action for automatic deployment
1 parent ed16ce0 commit a03fc75

4 files changed

Lines changed: 237 additions & 90 deletions

File tree

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,25 @@ jobs:
2929
- name: Checkout
3030
uses: actions/checkout@v4
3131

32-
- name: Setup Node.js
33-
uses: actions/setup-node@v4
32+
- name: Setup Bun
33+
uses: oven-sh/setup-bun@v1
3434
with:
35-
node-version: '18'
35+
bun-version: latest
36+
37+
- name: Change to source directory
38+
run: cd "Source code"
3639

3740
- name: Install dependencies
38-
run: npm ci
41+
run: bun install
3942

4043
- name: Build project
41-
run: npm run build:npm
44+
run: bun run build
4245

4346
- name: Upload artifact
4447
uses: actions/upload-pages-artifact@v3
4548
with:
46-
# Upload dist folder
47-
path: './dist'
49+
# Upload dist folder from the source directory
50+
path: './Source code/dist'
4851

4952
# Deploy job
5053
deploy:

README.md

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,52 @@
1-
# OpenHardware Initiative Website
1+
# Open Hardware Initiative Website
22

3-
This is the official website for the OpenHardware Initiative, a student-led group at TUM focused on hardware acceleration, chip design, and smart manufacturing systems.
3+
This repository contains the official website for the Open Hardware Initiative, built with React, TypeScript, and Vite.
44

5-
## 🚀 Project Overview
6-
- **Modern React website** built with Vite, TypeScript, and Tailwind CSS
7-
- **Static data** managed in TypeScript files (no database required)
8-
- **Fully responsive** and mobile-friendly
9-
- **Easy to maintain**: add or edit data by changing files in `src/data/`
10-
- **SPA routing** with React Router, including GitHub Pages support
5+
## 🚀 Deployment
116

12-
## 🗂️ Repository Structure
7+
This website is automatically deployed using **GitHub Actions**. When you push changes to the `main` branch, the following happens automatically:
8+
9+
1. **Build**: The source code is built using Bun and Vite
10+
2. **Deploy**: The built files are deployed to GitHub Pages
11+
3. **Live**: The site is available at [open-hardware-initiative.com](https://open-hardware-initiative.com)
12+
13+
### How it works
14+
15+
- The GitHub Actions workflow is located in `.github/workflows/deploy.yml`
16+
- It uses Bun for faster dependency installation and builds
17+
- The workflow runs on every push to the `main` branch
18+
- No manual build or deployment steps are needed
19+
20+
## 📁 Project Structure
1321

1422
```
15-
/
16-
├── Source code/ # Main website source (React, Vite, etc.)
17-
│ ├── src/ # App source code
18-
│ │ ├── components/ # React components
19-
│ │ ├── data/ # All data (people, events, projects)
20-
│ │ ├── pages/ # Page components
21-
│ │ └── ...
22-
│ ├── public/ # Static assets (images, uploads, etc.)
23-
│ ├── ...
24-
│ └── ...
25-
├── media/ # Additional media assets
26-
├── lovable-uploads/ # Uploaded images
27-
├── ...
23+
├── .github/workflows/ # GitHub Actions deployment workflow
24+
├── Source code/ # Main source code directory
25+
│ ├── src/ # React components and pages
26+
│ ├── public/ # Static assets
27+
│ ├── data/ # Content data files
28+
│ └── ... # Configuration files
29+
├── media/ # Media assets (images, etc.)
30+
└── README.md # This file
2831
```
2932

30-
## 🛠️ Tech Stack
31-
- [React](https://react.dev/)
32-
- [Vite](https://vitejs.dev/)
33-
- [TypeScript](https://www.typescriptlang.org/)
34-
- [Tailwind CSS](https://tailwindcss.com/)
35-
- [Bun](https://bun.sh/) (for local development/build)
33+
## 🛠️ Development
34+
35+
For local development, see the [Source code/README.md](Source%20code/README.md) file for detailed instructions.
36+
37+
## 📝 Content Management
3638

37-
## 📦 Website Configuration Management
38-
- All code is in `Source code/src/data/` as TypeScript files
39-
- See `Source_code/README.md`, `Source_code/APPLICATION_CONFIG_README.md` & `Source_code/DATA_MANAGEMENT_README.md` for details on adding/editing data
39+
- **Team Members**: Edit `Source code/data/peopleData.ts`
40+
- **Projects**: Edit `Source code/data/projectsData.ts`
41+
- **Events**: Edit `Source code/data/eventsData.ts`
42+
- **Application Status**: Edit `Source code/src/config/applicationConfig.ts`
4043

41-
## 🏗️ Building & Deploying
42-
See `Source_code/DEPLOYMENT_README.md` for full instructions.
44+
## 🔧 Configuration
4345

44-
## 🌐 Hosting
45-
- Designed for GitHub Pages, but can be hosted on Vercel, Netlify, etc.
46-
- SPA routing is supported everywhere (see Vite config and `_redirects`/`vercel.json`)
46+
- **Custom Domain**: Configured via `Source code/CNAME`
47+
- **Application Links**: Managed in `Source code/src/config/applicationConfig.ts`
48+
- **Build Settings**: Configured in `Source code/vite.config.ts`
4749

48-
---
50+
## 📞 Support
4951

50-
For more details, see the documentation files in the repo.
52+
For questions or issues, please contact the development team or create an issue in this repository.

Source code/README.md

Lines changed: 172 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,172 @@
1-
# OpenHardware Initiative Website — Source Code
2-
3-
This folder contains the full source code for the OpenHardware Initiative website.
4-
5-
## 📁 Structure
6-
- `src/` — Main app source code
7-
- `components/` — React UI components
8-
- `data/` — All data (people, events, projects)
9-
- `pages/` — Page components
10-
- `...`
11-
- `public/` — Static assets (images, uploads, etc.)
12-
13-
## 📦 Data Management
14-
- See [`DATA_MANAGEMENT_README.md`](DATA_MANAGEMENT_README.md) for how to add or edit people, events, or projects.
15-
- See [`APPLICATION_CONFIG_README.md`](APPLICATION_CONFIG_README.md) for how to set-up & remove an application form.
16-
17-
## 🏗️ Building & Deploying
18-
See [`DEPLOYMENT_README.md`](DEPLOYMENT_README.md) for how to build and deploy the site with Bun and GitHub Pages.
19-
20-
## ⚡ Quick Start
21-
1. Install dependencies (if needed):
22-
```sh
23-
bun install
24-
```
25-
2. Start the dev server (test the website locally):
26-
```sh
27-
bun run dev
28-
```
29-
3. Build for production:
30-
```sh
31-
bun run build
32-
```
33-
34-
## 🛠️ Development
35-
- Built with [React](https://react.dev/), [Vite](https://vitejs.dev/), [TypeScript](https://www.typescriptlang.org/), [Tailwind CSS](https://tailwindcss.com/), and [Bun](https://bun.sh/)
36-
- All data is managed in `src/data/` as TypeScript files
37-
- No database or CMS required
38-
39-
## 📝 Notes
40-
- SPA routing is supported for GitHub Pages, Vercel, and Netlify
41-
- All application links are managed via `src/config/applicationConfig.ts`
42-
43-
---
44-
45-
For more, see the main repo README and the documentation files.
1+
# Open Hardware Initiative Website - Source Code
2+
3+
This directory contains the source code for the Open Hardware Initiative website, built with React, TypeScript, and Vite.
4+
5+
## 🚀 Quick Start
6+
7+
### Prerequisites
8+
- [Bun](https://bun.sh/) (recommended) or Node.js 18+
9+
- Git
10+
11+
### Development
12+
```bash
13+
# Install dependencies
14+
bun install
15+
16+
# Start development server
17+
bun run dev
18+
19+
# The site will be available at http://localhost:8080
20+
```
21+
22+
### Building Locally
23+
```bash
24+
# Build for production
25+
bun run build
26+
27+
# Preview production build
28+
bun run preview
29+
```
30+
31+
## 🚀 Deployment
32+
33+
**No manual deployment needed!** This project uses GitHub Actions for automatic deployment:
34+
35+
1. **Push to main branch** → Automatic build and deploy
36+
2. **Site goes live** at [open-hardware-initiative.com](https://open-hardware-initiative.com)
37+
38+
The GitHub Actions workflow (`.github/workflows/deploy.yml`) handles:
39+
- Installing dependencies with Bun
40+
- Building the project
41+
- Deploying to GitHub Pages
42+
43+
## 📁 Project Structure
44+
45+
```
46+
src/
47+
├── components/ # React components
48+
│ ├── ui/ # Reusable UI components (shadcn/ui)
49+
│ └── ... # Page-specific components
50+
├── pages/ # Page components
51+
├── data/ # Content data files
52+
├── hooks/ # Custom React hooks
53+
├── lib/ # Utility libraries
54+
├── utils/ # Helper functions
55+
└── config/ # Configuration files
56+
57+
public/ # Static assets
58+
├── media/ # Images and media files
59+
├── lovable-uploads/ # Uploaded content
60+
└── ... # Other static files
61+
62+
data/ # Content data (TypeScript files)
63+
├── peopleData.ts # Team member information
64+
├── projectsData.ts # Project showcase data
65+
└── eventsData.ts # Events and activities
66+
```
67+
68+
## 📝 Content Management
69+
70+
### Adding/Editing Team Members
71+
Edit `src/data/peopleData.ts`:
72+
```typescript
73+
export const peopleData = [
74+
{
75+
name: "John Doe",
76+
role: "Team Member",
77+
image: "/media/team/john-doe.jpg",
78+
// ... other fields
79+
}
80+
];
81+
```
82+
83+
### Adding/Editing Projects
84+
Edit `src/data/projectsData.ts`:
85+
```typescript
86+
export const projectsData = [
87+
{
88+
title: "Project Name",
89+
description: "Project description",
90+
image: "/media/projects/project.jpg",
91+
// ... other fields
92+
}
93+
];
94+
```
95+
96+
### Adding/Editing Events
97+
Edit `src/data/eventsData.ts`:
98+
```typescript
99+
export const eventsData = [
100+
{
101+
title: "Event Name",
102+
date: "2024-01-15",
103+
description: "Event description",
104+
// ... other fields
105+
}
106+
];
107+
```
108+
109+
### Managing Application Status
110+
Edit `src/config/applicationConfig.ts`:
111+
```typescript
112+
export const applicationConfig = {
113+
isOpen: false, // Set to true to enable applications
114+
formUrl: "https://forms.google.com/your-form", // Google Form URL
115+
closedMessage: "Application period is currently closed."
116+
};
117+
```
118+
119+
## 🛠️ Tech Stack
120+
121+
- **Framework**: React 18 with TypeScript
122+
- **Build Tool**: Vite
123+
- **Styling**: Tailwind CSS + shadcn/ui components
124+
- **Package Manager**: Bun (faster than npm)
125+
- **Routing**: React Router DOM
126+
- **Deployment**: GitHub Actions + GitHub Pages
127+
128+
## 🔧 Configuration Files
129+
130+
- `vite.config.ts` - Build configuration
131+
- `tailwind.config.ts` - Tailwind CSS configuration
132+
- `tsconfig.json` - TypeScript configuration
133+
- `CNAME` - Custom domain configuration
134+
135+
## 📦 Available Scripts
136+
137+
- `bun run dev` - Start development server
138+
- `bun run build` - Build for production
139+
- `bun run preview` - Preview production build
140+
- `bun run lint` - Run ESLint
141+
142+
## 🎨 UI Components
143+
144+
This project uses [shadcn/ui](https://ui.shadcn.com/) components for consistent design. All components are in `src/components/ui/`.
145+
146+
## 📱 Responsive Design
147+
148+
The website is fully responsive and mobile-friendly. All components are designed to work on:
149+
- Desktop (1024px+)
150+
- Tablet (768px - 1023px)
151+
- Mobile (< 768px)
152+
153+
## 🔍 SEO & Performance
154+
155+
- Optimized for search engines
156+
- Fast loading with Vite
157+
- Proper meta tags and structured data
158+
- Responsive images and lazy loading
159+
160+
## 🐛 Troubleshooting
161+
162+
### Common Issues
163+
164+
1. **Port already in use**: Change the port in `vite.config.ts`
165+
2. **Build errors**: Check TypeScript errors with `bun run lint`
166+
3. **Missing dependencies**: Run `bun install`
167+
168+
### Getting Help
169+
170+
- Check the [main README.md](../README.md) for repository overview
171+
- Create an issue in the repository for bugs
172+
- Contact the development team for questions

Source code/vite.config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ import { defineConfig } from "vite";
22
import react from "@vitejs/plugin-react-swc";
33
import path from "path";
44
import { componentTagger } from "lovable-tagger";
5+
import fs from "fs";
6+
7+
// Plugin to copy CNAME file to dist
8+
const copyCNAME = () => ({
9+
name: 'copy-cname',
10+
writeBundle() {
11+
// Copy CNAME file to dist folder
12+
if (fs.existsSync('CNAME')) {
13+
fs.copyFileSync('CNAME', 'dist/CNAME');
14+
}
15+
},
16+
});
517

618
// https://vitejs.dev/config/
719
export default defineConfig(({ mode }) => ({
@@ -19,6 +31,7 @@ export default defineConfig(({ mode }) => ({
1931
},
2032
plugins: [
2133
react(),
34+
copyCNAME(),
2235
mode === 'development' &&
2336
componentTagger(),
2437
].filter(Boolean),
@@ -27,4 +40,6 @@ export default defineConfig(({ mode }) => ({
2740
"@": path.resolve(__dirname, "./src"),
2841
},
2942
},
43+
// Copy CNAME and other important files to dist
44+
publicDir: 'public',
3045
}));

0 commit comments

Comments
 (0)