@@ -10,3 +10,45 @@ Progression: Kōhai → Senpai → Sensei based on peer recognition.
1010
1111### [ Blockchain Roles] ( ./spec/BLOCKCHAIN.md )
1212Wallet-linked roles based on Starknet state (NFT ownership, token holdings, etc.).
13+
14+ ## Deployment
15+
16+ The bot uses GitHub Actions for CI and Railway for deployment.
17+ Pushes to ` main ` automatically deploy after CI passes.
18+
19+ ### Setup
20+
21+ 1 . ** Create Railway Project**
22+ - Go to [ railway.app] ( https://railway.app ) and sign in with GitHub
23+ - Click "New Project" → "Deploy from GitHub repo"
24+ - Select the ` daimyo ` repository
25+
26+ 2 . ** Set Environment Variables**
27+ - In Railway, go to your service → Variables
28+ - Add the following (see ` backend/.env.example ` for reference):
29+ ```
30+ DISCORD_BOT_TOKEN=<your token>
31+ DISCORD_GUILD_ID=<your guild id>
32+ DISCORD_CLIENT_ID=<your client id>
33+ DOJO_EMOJI_NAME=dojo
34+ KOHAI_ROLE_ID=<role id>
35+ SENPAI_ROLE_ID=<role id>
36+ SENSEI_ROLE_ID=<role id>
37+ DATABASE_PATH=/data/daimyo.db
38+ DECAY_WINDOW_DAYS=360
39+ SENPAI_REACTION_THRESHOLD=50
40+ SENPAI_UNIQUE_PERCENT=0.10
41+ SENSEI_REACTION_THRESHOLD=30
42+ SENSEI_UNIQUE_PERCENT=0.20
43+ ```
44+
45+ 3. **Create Volume for Database**
46+ - In Railway, click your service → Settings → Volumes
47+ - Add a volume with mount path `/data`
48+ - This persists the SQLite database across deployments
49+
50+ 4. **(Optional) GitHub Branch Protection**
51+ - Go to GitHub repo → Settings → Branches
52+ - Add rule for `main` branch
53+ - Enable "Require status checks to pass before merging"
54+ - Select the `ci` check
0 commit comments