Hosting Environment
- Provider: cdmon
- Server Type: Shared hosting with PHP support
- Protocol: SFTP on port 22
- Target Directory:
/web - Domain: Configured through cdmon control panel
Automated SFTP Deployment
The primary deployment method is automated via GitHub Actions using theappleboy/scp-action tool.
Deployment Configuration
How It Works
- Source: All files from the
dist/folder (built by Astro) - Target: Uploaded to
/webdirectory on cdmon server - Strip components: Removes the
dist/prefix, sodist/index.htmlbecomes/web/index.html - Overwrite: Replaces existing files with new versions
Sync Process
The SFTP deployment synchronizes the entiredist/ folder:
What Gets Deployed
- ✅ Static HTML pages
- ✅ CSS and JavaScript assets in
_astro/folder - ✅ PHP API proxy (
/api/proxy.php) - ✅ Public assets (images, fonts, favicon)
- ✅ All subdirectories and routes
What Doesn’t Get Deployed
- ❌ Source code (
src/folder) - ❌ Node modules
- ❌ Development configuration files
- ❌
.gitrepository data
Manual SFTP Deployment
For emergency deployments or testing, you can deploy manually using SFTP clients.Using FileZilla
- Download FileZilla from filezilla-project.org
- Connect to server:
- Protocol: SFTP
- Host: Your cdmon SFTP hostname
- Port: 22
- Username: Your SFTP username
- Password: Your SFTP password
- Navigate to
/webon the remote side - Build locally: Run
npm run build - Upload: Drag contents of
dist/folder to/web/ - Verify: Check the website is working correctly
Using Command Line (sftp)
Using rsync over SSH
For more efficient uploads (only changed files):--delete flag removes files on the server that no longer exist locally.
Backup Protocol
As documented inhandoff1.3.md:38, the development team maintains manual backups of stable releases.
Backup Procedure
-
Build stable version:
-
Copy to backup folder:
-
Archive with timestamp:
- Store in backup repository: Developer uploads to separate backup Git repository
Why Maintain Backups
- Rapid rollback if automated deployment fails
- Known-good states for stable releases
- External API protection in case eGO API is temporarily unavailable
- Disaster recovery if cdmon hosting has issues
Rollback Procedures
If a deployment introduces issues, you can rollback to the previous version.Automatic Rollback Protection
The GitHub Actions workflow includes built-in validation (.github/workflows/deploy.yml:32) that prevents deploying broken builds:
Manual Rollback Steps
If a bad deployment makes it to production:-
Retrieve backup:
-
Connect via SFTP:
-
Upload backup:
- Verify site is restored
Rollback Using Git
If the issue is code-related:-
Revert the commit:
- Wait for automatic deployment (or trigger manually)
- Monitor GitHub Actions to ensure successful deployment
Deployment Verification
After any deployment (automated or manual), verify:1. Homepage Loads
Visit the main domain and check:- ✅ Page renders correctly
- ✅ Styles are applied
- ✅ Images load
- ✅ JavaScript animations work
2. Properties Page
Visit/propiedades and verify:
- ✅ Property cards are displayed
- ✅ Property data is current
- ✅ Images load for each property
- ✅ Filtering and search work (if applicable)
3. PHP Proxy Works
Test the API proxy at/api/proxy.php:
4. Console Errors
Open browser DevTools and check for:- ❌ 404 errors for missing assets
- ❌ JavaScript errors
- ❌ CORS errors
Deployment Troubleshooting
SFTP Permission Denied
Error: “Permission denied” when uploading Cause: Incorrect SFTP credentials or insufficient permissions Solution:- Verify username and password
- Check cdmon control panel for SFTP access settings
- Ensure
/webdirectory is writable
PHP Files Not Executing
Issue:proxy.php downloads instead of executing
Cause: cdmon server not recognizing PHP files
Solution:
- Verify file has
.phpextension (not.php.txt) - Check cdmon PHP version is enabled for the domain
- Review
.htaccessif present
Missing Files After Deployment
Issue: Some files present indist/ not on server
Cause: SFTP upload incomplete or selective sync
Solution:
- Use
overwrite: truein SCP action (already configured) - Manually upload missing files via FileZilla
- Check GitHub Actions logs for upload errors
Old Files Persisting
Issue: Deleted files still appear on production Cause: SFTP only uploads/overwrites, doesn’t delete Solution:- Manually delete old files via SFTP client
- For automated cleanup, consider using rsync with
--deleteflag instead ofappleboy/scp-action
Performance Considerations
Upload Time
Typical SFTP upload duration:- Fresh upload: 60-90 seconds
- Incremental: N/A (SCP uploads all files)
- Factors: File count, total size, network speed
Optimizing Uploads
To speed up deployments:- Compress assets - Already done via
compressHTML: trueinastro.config.mjs:10 - Reduce file count - Astro bundles CSS/JS automatically
- Use CDN - Consider offloading static assets to CDN (future enhancement)
Security Best Practices
- ✅ Use SFTP (port 22) instead of FTP (port 21) for encryption
- ✅ Store credentials in GitHub Secrets - Never commit to repository
- ✅ Rotate passwords regularly in cdmon control panel
- ✅ Limit access - Only grant SFTP access to necessary team members
- ❌ Don’t use root - Use dedicated SFTP user for deployment
- ❌ Don’t commit
.env- Keep API tokens out of version control