Appearance
Laravel Forge Deployment
This guide explains setting up and deploying to Laravel Forge staging environments.
Table of Contents
- Overview
- Forge Setup
- Deployment Script
- Environment Configuration
- Deployment Process
- Best Practices
- Related Documentation
Overview
Laravel Forge is used for managing staging environments. This guide covers setting up Forge and deploying LamaPress themes.
Forge Setup
Server Provisioning
- Provision server in Forge
- Install PHP (8.4)
- Install Node.js (v24 LTS)
- Install Composer
- Configure web server (Nginx)
Site Creation
- Create site in Forge
- Set domain (e.g.,
staging.example.com) - Configure web directory (
public) - Set PHP version (8.4)
Git Repository
Connect Git repository:
- Repository:
https://github.com/lamalamanl/lamapress.git - Branch:
mainordevelop
- Repository:
Configure deployment:
- Enable automatic deployments
- Set deployment branch
Deployment Script
Build Assets
Deployment script should build assets:
bash
cd /home/forge/staging.example.com/wp-content/themes/lamapress
npm ci
npm run buildWordPress Setup
Ensure WordPress is set up:
bash
# WordPress should be installed in public directory
# Theme should be in wp-content/themes/lamapressEnvironment Configuration
Environment Variables
Set environment variables in Forge:
DB_NAME- Database nameDB_USER- Database userDB_PASSWORD- Database passwordDB_HOST- Database host
WordPress Constants
Configure wp-config.php:
php
define('WP_DEBUG', false);
define('WP_DEBUG_LOG', false);Deployment Process
Automatic Deployments
Forge automatically deploys on push:
- Push to repository
- Forge detects changes
- Runs deployment script
- Builds assets
- Deploys to server
Manual Deployments
Deploy manually in Forge:
- Go to site in Forge dashboard
- Click "Deploy Now"
- Monitor deployment logs
Best Practices
1. Test on Staging
Always test on staging before production:
- Verify functionality
- Check assets load
- Test page transitions
2. Use Environment Variables
Use environment variables for configuration:
- Database credentials
- API keys
- Environment settings
3. Monitor Deployments
Monitor deployment logs:
- Check for errors
- Verify build success
- Confirm asset deployment
Related Documentation
- Deployment Overview - Deployment process
- Environment Configuration - Environment setup
- Production Checklist - Pre-deployment checklist
Next Steps:
- Review Deployment Overview for deployment process
- Check Environment Configuration for environment setup
- See Production Checklist for pre-deployment steps