Skip to content

Commit 02055ff

Browse files
committed
Add GitHub Pages deployment workflow and docs updates
Introduces a GitHub Actions workflow for automatic deployment to GitHub Pages. Updates README with setup, build, and deployment instructions. Adds a deploy script and gh-pages dependency to package.json. Adjusts Vite config to set base path for production deployments.
1 parent 6ac64ad commit 02055ff

File tree

4 files changed

+110
-4
lines changed

4 files changed

+110
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '20'
29+
cache: 'npm'
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Build
35+
run: npm run build
36+
env:
37+
NODE_ENV: production
38+
39+
- name: Setup Pages
40+
uses: actions/configure-pages@v4
41+
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: ./dist
46+
47+
deploy:
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
runs-on: ubuntu-latest
52+
needs: build
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

README.md

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,50 @@
1-
# tinypine-docs
2-
🌲 Official documentation site for TinyPine.js — minimal reactive UI framework.
1+
# TinyPine.js Documentation
2+
3+
🌲 Official documentation website for TinyPine.js - a minimal, reactive JavaScript framework.
4+
5+
## 🚀 Quick Start
6+
7+
### Development
8+
9+
```bash
10+
# Install dependencies
11+
npm install
12+
13+
# Start dev server
14+
npm run dev
15+
```
16+
17+
### Build
18+
19+
```bash
20+
# Build for production
21+
npm run build
22+
23+
# Preview production build
24+
npm run preview
25+
```
26+
27+
### Deploy to GitHub Pages
28+
29+
```bash
30+
# Deploy manually
31+
npm run deploy
32+
```
33+
34+
Or push to the `main` branch and GitHub Actions will automatically deploy.
35+
36+
## 📦 Tech Stack
37+
38+
- **Framework**: [TinyPine.js](https://github.com/DigitalCoreHub/tinypine)
39+
- **Build Tool**: [Vite](https://vitejs.dev/)
40+
- **Styling**: [Tailwind CSS](https://tailwindcss.com/)
41+
- **Markdown**: [Marked](https://marked.js.org/)
42+
- **Syntax Highlighting**: [Highlight.js](https://highlightjs.org/)
43+
44+
## 🌐 Live Site
45+
46+
Visit the documentation at: [https://digitalcorehub.github.io/tinypine-docs/](https://digitalcorehub.github.io/tinypine-docs/)
47+
48+
## 📝 License
49+
50+
MIT © DigitalCoreHub

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "vite build",
9-
"preview": "vite preview"
9+
"preview": "vite preview",
10+
"deploy": "npm run build && gh-pages -d dist"
1011
},
1112
"keywords": [
1213
"tinypine",
@@ -20,6 +21,7 @@
2021
"devDependencies": {
2122
"@tailwindcss/typography": "^0.5.19",
2223
"autoprefixer": "^10.4.20",
24+
"gh-pages": "^6.2.0",
2325
"postcss": "^8.4.49",
2426
"tailwindcss": "^3.4.17",
2527
"vite": "^6.0.3"

vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from 'vite'
22

33
export default defineConfig({
4-
base: '/',
4+
base: process.env.NODE_ENV === 'production' ? '/tinypine-docs/' : '/',
55
build: {
66
outDir: 'dist',
77
assetsDir: 'assets',

0 commit comments

Comments
 (0)