s:CMS Update & Deployment System
Overview
s:CMS uses a core/usr separation architecture that allows you to:
- β Receive framework updates without losing customizations
- π‘οΈ Keep your content and configurations protected
- π Deploy to any platform (GitHub Pages, Netlify, Vercel, etc.)
Quick Commands
# One-time setup (after creating from template)npm run setup-upstream
# Update to latest s:CMS versionnpm run update-core
# Deploygit push # Auto-deploys via GitHub ActionsFile Structure
s:CMS/βββ core/ # β Framework code (receives updates)β βββ components/ # React & Astro componentsβ βββ layouts/ # Base layoutsβ βββ utils/ # Framework utilitiesββββ usr/ # β
Your code (always protected)β βββ content/ # Your content (MDX, blog posts)β βββ pages/ # Your pagesβ βββ components/ # Your custom componentsβ βββ layouts/ # Your custom layoutsβ βββ public/ # Your static assetsβ βββ user.config.mjs # Your site configurationββββ scripts/ # Update automation scriptsβ βββ setup-upstream.shβ βββ update-core.shββββ docs/β βββ UPDATING.md # Detailed update guideβ βββ DEPLOYMENT.md # Deployment instructionsββββ .gitattributes # Protects usr/ during mergesHow It Works
1. Protected Folders
.gitattributes tells git to preserve usr/** during merges:
usr/** merge=ours2. Update Script
npm run update-core automates:
- Creates backup branch
- Fetches latest s:CMS release
- Merges with
usr/protection - Installs new dependencies
- Shows what changed
3. Merged Configs
astro.config.mjs combines core + user settings:
import coreConfig from './core/core.config.mjs'import userConfig from './usr/user.config.mjs'export default merge(coreConfig, userConfig)Update Workflow
ββββββββββββββββββββββββββββββββββββββββββββ 1. Run: npm run update-core ββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββ 2. Script creates backup branch ββ backup-before-update-TIMESTAMP ββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββ 3. Fetches latest from upstream ββ github.com/lad-sapienza/sCMS ββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββ 4. Shows preview of changes ββ You confirm to proceed ββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββ 5. Merges updates ββ β’ core/ updated ββ β’ usr/ protected ββ β’ configs merged ββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββ 6. Installs new dependencies ββ npm install (if package.json changed)ββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββ 7. Test: npm run dev ββ If OK: delete backup branch ββ If issues: git reset --hard backup ββββββββββββββββββββββββββββββββββββββββββββDeployment Options
GitHub Pages (Included)
- β
Workflow already configured:
.github/workflows/deploy.yml - β Push to main β automatic deployment
- Set repo to public or GitHub Pro for private repos
Other Platforms
- Netlify: Build command
npm run build, Publish dirdist - Vercel: Auto-detects Astro, just connect repo
- Cloudflare Pages: Same as Netlify
- Traditional hosting: Upload
dist/folder afternpm run build
Configuration
Site URL
Edit usr/user.config.mjs:
export const siteMetadata = { siteUrl: 'https://yourdomain.com', title: 'Your Site Title', // ... other settings}Astro Settings
Edit usr/user.config.mjs:
export const userConfig = { integrations: [ // Your custom integrations ], // Other Astro config overrides}Handling Merge Conflicts
If package.json conflicts occur:
- Keep your dependencies
- Add new framework dependencies
- Update shared dependencies to newer versions
Example merge:
// Your version + upstream version = merged result{ "dependencies": { "astro": "^5.1.0", // Updated version "my-package": "^1.0.0", // Your addition "photoswipe": "^5.4.4" // New framework dep }}Best Practices
- β
Never edit
core/- Framework receives updates - β
Customize in
usr/- Always protected - β Update regularly - Easier than large jumps
- β
Test after updating - Run
npm run dev - β Read changelogs - Know whatβs changing
For More Details
- π Complete Update Guide
- π Deployment Instructions
- π§ Configuration Guide