GitHub Integration
Connect Pagesmith to GitHub. Sync your project, collaborate with version control.
Connect your Pagesmith project to GitHub for version control, collaboration, and CI/CD.
Why Use GitHub?
- Version control — Full git history of your project
- Collaboration — Team members can contribute via PRs
- CI/CD — Deploy with GitHub Actions
- Backup — Code exists outside Pagesmith
- Open source — Make your project public
Connecting GitHub
- Go to Settings → Integrations
- Click Connect GitHub
- Authorize Pagesmith
- Select or create a repository
- Choose sync settings
Sync Options
Push to GitHub
Changes in Pagesmith sync to GitHub:
- Each publish creates a commit
- Commit messages describe changes
- History preserved in git
Pull from GitHub
Changes in GitHub sync to Pagesmith:
- Pushes to main branch update the project
- Enable for developer collaboration
- Pagesmith rebuilds on change
Bidirectional
Both directions enabled:
- Edit in Pagesmith or your IDE
- Changes sync both ways
- Best for active development
Repository Structure
When synced, your GitHub repo contains:
your-repo/
├── src/
│ ├── pages/
│ ├── components/
│ └── layouts/
├── public/
├── astro.config.mjs
├── package.json
├── tailwind.config.mjs
└── README.md
Standard Astro project structure. Clone and run locally with:
npm install
npm run dev
Working with GitHub
Editing in Your IDE
- Clone the repository
- Make changes locally
- Push to main branch
- Pagesmith syncs automatically
Using Branches
Create branches for features:
git checkout -b feature/new-section
# Make changes
git push origin feature/new-section
# Create PR in GitHub
# Merge to main
# Pagesmith syncs
Collaborating
- Add collaborators in GitHub
- They can push or create PRs
- Merged changes sync to Pagesmith
- Preview in Pagesmith before publishing
CI/CD with GitHub Actions
Deploy to other hosts on push:
# .github/workflows/deploy.yml
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npm run build
# Add your deployment step
Disconnecting GitHub
- Go to Settings → Integrations
- Click Disconnect GitHub
- Your code remains in both places
- No further syncing
Troubleshooting
Sync Conflicts
If changes happen in both places:
- Pagesmith will show a conflict warning
- Review changes before resolving
- Choose which version to keep
Authorization Issues
If sync stops working:
- Check GitHub authorization in settings
- Re-authorize if needed
- Verify repository still exists
Large Files
Git has file size limits:
- Images should be compressed
- Avoid committing node_modules
- Use Git LFS for large assets if needed
Related Docs
- Export — Download code without GitHub
- Hosting Options — Deploy elsewhere
- Version History — Built-in history