Skip to content

Commit 0456c81

Browse files
committed
docs: update deployment path to /opt/codeframe and add server setup
- Changed recommended PROJECT_PATH from home directory to /opt/codeframe - Added Step 1: Set Up Project Directory on Server - Included git clone instructions - Added initial server setup section with: - Environment file creation (.env.staging) - Python dependency installation (venv + uv) - Frontend dependency installation (npm) - PM2 configuration notes - Renumbered subsequent steps (now Steps 2-7) - Follows standard deployment conventions for production environments
1 parent 1062785 commit 0456c81

File tree

1 file changed

+60
-7
lines changed

1 file changed

+60
-7
lines changed

docs/github-actions-ssh-setup.md

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,59 @@ This document describes how to configure SSH access for GitHub Actions to deploy
88
- GitHub repository admin access (to add secrets)
99
- SSH client installed locally
1010

11-
## Step 1: Generate SSH Key Pair
11+
## Step 1: Set Up Project Directory on Server
12+
13+
On the staging server, create the project directory and clone the repository:
14+
15+
```bash
16+
# Create directory
17+
sudo mkdir -p /opt/codeframe
18+
sudo chown $USER:$USER /opt/codeframe
19+
20+
# Clone repository
21+
cd /opt/codeframe
22+
git clone https://github.com/YOUR_USERNAME/codeframe.git .
23+
24+
# Verify git is set up correctly
25+
git remote -v
26+
git status
27+
```
28+
29+
**Note**: The deployment workflow uses `git fetch` and `git reset --hard`, so the project must be a git repository on the server.
30+
31+
### Initial Server Setup
32+
33+
After cloning, set up the environment:
34+
35+
```bash
36+
cd /opt/codeframe
37+
38+
# Create environment file (copy from example or create new)
39+
cp .env.example .env.staging
40+
# Edit .env.staging with staging-specific values
41+
nano .env.staging
42+
43+
# Install Python dependencies
44+
python3 -m venv .venv
45+
source .venv/bin/activate
46+
pip install uv
47+
uv sync
48+
49+
# Install frontend dependencies
50+
cd web-ui
51+
npm install
52+
npm run build
53+
cd ..
54+
55+
# Set up PM2 configuration (if not already committed)
56+
# Create ecosystem.staging.config.js with appropriate ports
57+
```
58+
59+
**Important files to configure:**
60+
- `.env.staging` - Environment variables for staging
61+
- `ecosystem.staging.config.js` - PM2 process configuration
62+
63+
## Step 2: Generate SSH Key Pair
1264

1365
On your local machine or the staging server:
1466

@@ -23,7 +75,7 @@ This creates two files:
2375
- `~/.ssh/github_actions_staging` (private key) - for GitHub Secrets
2476
- `~/.ssh/github_actions_staging.pub` (public key) - for staging server
2577

26-
## Step 2: Add Public Key to Staging Server
78+
## Step 3: Add Public Key to Staging Server
2779

2880
Copy the public key to the staging server's authorized_keys:
2981

@@ -42,7 +94,7 @@ chmod 700 ~/.ssh
4294
chmod 600 ~/.ssh/authorized_keys
4395
```
4496

45-
## Step 3: Test SSH Connection
97+
## Step 4: Test SSH Connection
4698

4799
Verify the key works:
48100

@@ -52,7 +104,7 @@ ssh -i ~/.ssh/github_actions_staging your-user@staging-server 'echo "Connection
52104

53105
Expected output: "Connection successful"
54106

55-
## Step 4: Configure GitHub Environment and Secrets
107+
## Step 5: Configure GitHub Environment and Secrets
56108

57109
### Create Environment
58110

@@ -93,11 +145,12 @@ cat ~/.ssh/github_actions_staging
93145

94146
- Name: `PROJECT_PATH`
95147
- Value: Absolute path to the CodeFRAME project on staging server
96-
- Example: `/home/frankbria/projects/codeframe`
148+
- Example: `/opt/codeframe`
149+
- **Recommended**: Use `/opt/codeframe` for staging/production deployments
97150

98151
**Note**: These generic secret names can be reused across different environments (staging, production, etc.) by configuring them in each environment separately.
99152

100-
## Step 5: Verify Environment Configuration
153+
## Step 6: Verify Environment Configuration
101154

102155
After adding all secrets, verify in **Settings****Environments****staging**:
103156

@@ -107,7 +160,7 @@ After adding all secrets, verify in **Settings** → **Environments** → **stag
107160
- ✅ USER configured
108161
- ✅ PROJECT_PATH configured
109162

110-
## Step 6: Test Deployment Workflow
163+
## Step 7: Test Deployment Workflow
111164

112165
1. Push a commit to the `staging` or `development` branch
113166
2. Go to **Actions** tab in GitHub repository

0 commit comments

Comments
 (0)