Skip to content
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
125 changes: 125 additions & 0 deletions .github/workflows/fhevm-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: FHEVM SDK CI/CD - mk83 Bounty Submission

on:
push:
branches: [ main, develop ]
paths:
- 'packages/fhevm-sdk/**'
pull_request:
branches: [ main ]
paths:
- 'packages/fhevm-sdk/**'

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18, 20]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: 'packages/fhevm-sdk/package-lock.json'

- name: Install dependencies
run: |
cd packages/fhevm-sdk
npm ci

- name: Type check
run: |
cd packages/fhevm-sdk
npm run type-check

- name: Lint
run: |
cd packages/fhevm-sdk
npm run lint

- name: Test
run: |
cd packages/fhevm-sdk
npm test

- name: Build
run: |
cd packages/fhevm-sdk
npm run build

- name: Upload coverage
uses: codecov/codecov-action@v3
with:
file: packages/fhevm-sdk/coverage/lcov.info
flags: fhevm-sdk
name: fhevm-sdk-coverage

build:
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v4

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: 'packages/fhevm-sdk/package-lock.json'

- name: Install dependencies
run: |
cd packages/fhevm-sdk
npm ci

- name: Build package
run: |
cd packages/fhevm-sdk
npm run build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: fhevm-sdk-dist
path: packages/fhevm-sdk/dist/
retention-days: 7

publish:
runs-on: ubuntu-latest
needs: [test, build]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'

steps:
- uses: actions/checkout@v4

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
cache-dependency-path: 'packages/fhevm-sdk/package-lock.json'

- name: Install dependencies
run: |
cd packages/fhevm-sdk
npm ci

- name: Build package
run: |
cd packages/fhevm-sdk
npm run build

- name: Publish to npm
run: |
cd packages/fhevm-sdk
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
168 changes: 168 additions & 0 deletions DEPLOYMENT_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# 🚀 Public Deployment Guide

## 📋 Overview

This guide shows you how to deploy your Universal FHEVM SDK as a **public website** instead of running it locally.

## 🌐 Deployment Options

### **Option 1: Vercel (Recommended)**

#### **Step 1: Connect to Vercel**
1. Go to [vercel.com](https://vercel.com)
2. Sign in with your GitHub account
3. Click "New Project"
4. Import your repository: `https://github.com/mk83/fhevm-react-template`

#### **Step 2: Configure Settings**
- **Framework Preset**: Next.js
- **Root Directory**: `packages/site`
- **Build Command**: `npm run vercel-build`
- **Output Directory**: `.next`
- **Install Command**: `npm install`

#### **Step 3: Deploy**
- Click "Deploy"
- Wait for deployment to complete
- Your site will be available at: `https://your-project-name.vercel.app`

### **Option 2: Netlify**

#### **Step 1: Connect to Netlify**
1. Go to [netlify.com](https://netlify.com)
2. Sign in with your GitHub account
3. Click "New site from Git"
4. Choose your repository

#### **Step 2: Configure Build Settings**
- **Base directory**: `packages/site`
- **Build command**: `npm run build`
- **Publish directory**: `.next`

#### **Step 3: Deploy**
- Click "Deploy site"
- Your site will be available at: `https://your-project-name.netlify.app`

### **Option 3: GitHub Pages**

#### **Step 1: Enable GitHub Pages**
1. Go to your repository settings
2. Scroll to "Pages" section
3. Select "Deploy from a branch"
4. Choose `main` branch and `/packages/site` folder

#### **Step 2: Configure Build**
Add this to your `package.json`:
```json
{
"scripts": {
"build": "npm run clean && next build && next export"
}
}
```

## 🔧 Configuration Changes Made

### **1. Package.json**
```json
{
"private": false, // ← Changed from true to false
"scripts": {
"vercel-build": "npm run clean && next build"
}
}
```

### **2. Vercel.json**
```json
{
"buildCommand": "npm run vercel-build",
"outputDirectory": ".next",
"installCommand": "npm install",
"framework": "nextjs",
"public": true, // ← Added for public deployment
"github": {
"silent": false
}
}
```

## 🎯 What This Enables

### **Public Access**
- ✅ Anyone can access your website
- ✅ Share your SDK demo with others
- ✅ Perfect for bounty submission showcase

### **Easy Sharing**
- ✅ Share URL directly
- ✅ No need to run locally
- ✅ Works on any device

### **Professional Presentation**
- ✅ Live demo for Zama bounty judges
- ✅ Easy to showcase your work
- ✅ Professional deployment

## 🚀 Quick Deploy Commands

### **Deploy to Vercel**
```bash
# Install Vercel CLI
npm i -g vercel

# Deploy from packages/site directory
cd packages/site
vercel --prod
```

### **Deploy to Netlify**
```bash
# Install Netlify CLI
npm i -g netlify-cli

# Deploy from packages/site directory
cd packages/site
netlify deploy --prod --dir=.next
```

## 📱 Mobile-Friendly

Your deployed website will be:
- ✅ **Mobile responsive**
- ✅ **Fast loading**
- ✅ **SEO optimized**
- ✅ **Accessible from anywhere**

## 🎉 Benefits of Public Deployment

### **For Bounty Submission**
- ✅ **Live demo** for judges to see
- ✅ **Professional presentation**
- ✅ **Easy to share** with community
- ✅ **Shows technical skills**

### **For Community**
- ✅ **Easy access** for other developers
- ✅ **SDK showcase** for adoption
- ✅ **Documentation** always available
- ✅ **Interactive demo** for learning

## 🔗 Your Deployment URLs

After deployment, you'll have:
- **Main App**: `https://your-project.vercel.app`
- **SDK Demo**: `https://your-project.vercel.app/sdk-demo`
- **GitHub**: `https://github.com/mk83/fhevm-react-template`

## 🏆 Ready for Bounty Submission!

With public deployment, your Universal FHEVM SDK is now:
- ✅ **Publicly accessible**
- ✅ **Professional presentation**
- ✅ **Easy to share**
- ✅ **Ready for Zama bounty judges**

---

*Your Universal FHEVM SDK is now ready for public deployment! 🚀*
Loading