File Deploys
File deployments provide a straightforward way to deploy your website by uploading a zip archive of your application files directly through the Webslice Console. This deployment method is ideal for static sites, pre-built applications, or situations where you don’t need automated build processes from a git repository.
File deploys are atomic, meaning each upload needs to contain your complete website. This ensures consistency and eliminates potential issues from partial updates or missing files. Please use the shared persistent storage to store objects that need to be retained between deployments.
When you upload a zip file, it’s staged for review before going live. This gives you the opportunity to verify the upload was successful before triggering the actual deployment. Once you’re ready, simply click “Deploy this Zip” to make your website live.
File deployments are well-suited for:
- Pre-built static sites - Sites already built locally with generators like Hugo or Gatsby
- Quick prototypes - Rapid deployment of simple sites or demos without repository setup
- External build processes - Applications built by CI/CD pipelines outside of Webslice
- Simple PHP applications - Basic PHP sites that don’t require build steps
Uploading Your Website
- Prepare your zip file - Create a zip archive containing all your website files. The structure can be organized however you prefer, as you can configure the web directory path in your website settings.
- Navigate to Deploys - In the Webslice Console, go to your website and click the Deploys tab.
- Switch to File Uploads - Click the
Use File Uploadsbutton to enable the file deployment interface. - Upload your zip - Drag and drop your
.zipfile into the upload area, or click to browse and select it. - Review the staged deployment - Once uploaded, your zip file is staged and ready. Verify the file size and upload was successful.
- Deploy - Click
Deploy this Zipto push your website live.
Configuring Your Web Directory
Your zip file can be structured however makes sense for your project. Webslice allows you to configure which directory within the zip should serve as your web root through the website settings.
For example, if your zip contains:
your-website.zip├── public/ ← Your document root│ ├── index.php│ └── assets/├── src/└── vendor/You would set your document root to public in your website settings (Settings » Configuration & Performance), and Webslice will serve files from that directory. This flexibility lets you maintain your preferred project structure without reorganizing files for deployment.
Limitations of File Deployments
While file deployments are simple and effective for many use cases, they have some limitations compared to Git deployments:
- No build scripts - You cannot run
npm install,composer install, or compilation commands during deployment. All dependencies and built assets must be included in your zip file. - No release scripts - Post-deployment tasks like database migrations or cache warming are not available with file deployments.
- Manual uploads - Each deployment requires manually creating and uploading a new zip file. There’s no automated deployment from code changes.
- No version history - Unlike Git deployments, file deployments don’t maintain a history of changes or allow easy rollbacks to previous versions.
If these limitations impact your workflow, consider switching to Git Deployments which support build scripts, release scripts, and automated deployments from your repository.
Persistent Storage with File Deployments
File deployments support the the shared persistent storage, just like git deployments. The /shared directory persists across deployments and is perfect for user uploads, generated files, or any data that shouldn’t be replaced with each deployment.
However, since file deployments don’t support build or release scripts you’ll need to use SFTP Access to manage files in the shared directory. This is particularly useful for:
- Storing user submitted content, or files that are edited/written by your application
- Managing persistent data separately from your application code
- Maintaining files that change frequently without redeploying the entire site
Best Practices
- Test your zip locally - Extract your zip file to a fresh directory and verify everything works before deploying
- Include all dependencies - If your application uses Composer or npm packages, run
composer install --no-devornpm cilocally and include the vendor/node_modules in your zip - Optimize file sizes - Remove development files, tests, and documentation from production zips to reduce upload time
- Use consistent naming - Name your zips with dates or version numbers (e.g.,
mysite-2024-01-15.zip) for your own reference - Keep a deployment checklist - Maintain a list of files and directories that must be included in every deployment
- Consider Git for active development - If you’re making frequent changes, Git deployments with automated builds will save significant time