concept-collection / proofery-web
deploy
Jeremy Magland <jmagland@flatironinstitute.org> committed commit 5144da59716c parent c1bee11 Browse files
3 changed files+114−0
.github/workflows/deploy.ymladded+54−0View file
@@ -0,0 +1,54 @@
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+
37+ - name: Setup Pages
38+ uses: actions/configure-pages@v4
39+
40+ - name: Upload artifact
41+ uses: actions/upload-pages-artifact@v3
42+ with:
43+ path: './dist'
44+
45+ deploy:
46+ environment:
47+ name: github-pages
48+ url: ${{ steps.deployment.outputs.page_url }}
49+ runs-on: ubuntu-latest
50+ needs: build
51+ steps:
52+ - name: Deploy to GitHub Pages
53+ id: deployment
54+ uses: actions/deploy-pages@v4
DEPLOYMENT.mdadded+59−0View file
@@ -0,0 +1,59 @@
1+# GitHub Pages Deployment Guide
2+
3+This project is configured to automatically deploy to GitHub Pages via GitHub Actions.
4+
5+## Setup Instructions
6+
7+### 1. Enable GitHub Pages in Repository Settings
8+
9+1. Go to your GitHub repository
10+2. Navigate to **Settings** → **Pages**
11+3. Under **Source**, select **GitHub Actions**
12+
13+### 2. Push Your Changes
14+
15+Once you push to the `main` branch, the GitHub Action will automatically:
16+- Build the project
17+- Deploy to GitHub Pages
18+
19+```bash
20+git add .
21+git commit -m "Add GitHub Pages deployment"
22+git push origin main
23+```
24+
25+### 3. Access Your Site
26+
27+After the action completes successfully, your site will be available at:
28+```
29+https://<your-username>.github.io/proofery-web/
30+```
31+
32+## Manual Deployment
33+
34+You can also trigger a deployment manually:
35+1. Go to **Actions** tab in your repository
36+2. Select the **Deploy to GitHub Pages** workflow
37+3. Click **Run workflow**
38+
39+## Configuration
40+
41+- **Workflow file**: `.github/workflows/deploy.yml`
42+- **Base path**: `/proofery-web/` (configured in `vite.config.ts`)
43+- **Build output**: `dist/` directory
44+
45+## Troubleshooting
46+
47+If the deployment fails:
48+1. Check the Actions tab for error messages
49+2. Ensure GitHub Pages is enabled in repository settings
50+3. Verify the repository has the correct permissions set in the workflow
51+4. Make sure the `main` branch is the default branch
52+
53+## Local Testing
54+
55+To test the production build locally:
56+```bash
57+npm run build
58+npm run preview
59+```
vite.config.tsmodified+1−0View file
@@ -4,4 +4,5 @@ import react from '@vitejs/plugin-react'
44 // https://vite.dev/config/
55 export default defineConfig({
66 plugins: [react()],
7+ base: '/proofery-web/',
78 })