The deploy settings file
Every repository needs a deploy file at its top level before it can deploy. The panel makes one for you, so you don't write it by hand.
Make the file
- Open Account → Hosting → your site → Git and SSH.
- Open the repository's menu and choose Deploy file.
- Under Copy to, pick the site.
- Under Then, pick what to run:
| Choice | What happens | Suits |
|---|---|---|
| Copy files | Copies the repository into the site's folder | Static sites, PHP sites, WordPress themes |
| Run Composer | Installs PHP packages, then copies | Laravel and other Composer projects |
| Restart the app | Copies, then restarts the app | Node.js and Python apps |
- Tick Remove files on the site that aren't in the repository if the repository holds the whole site. Leave it off if the site also has files you add by hand.
- Click Download.
- Put the downloaded file at the top of your repository. Keep its name exactly as it downloads, including the dot at the start. Commit and push.
git add .
git commit -m "Add deploy file"
git push
What the file keeps
Deploys never replace or delete these on the site. A copy in your repository is skipped:
.envand.user.iniwp-content/uploadsandstoragetmpanderror_log
Deploys never delete these, even with Remove files on the site that aren't in the repository on. A copy committed in your repository does replace the site's copy:
.htaccess.well-knownandcgi-bin
Git's own files and the deploy file itself are never copied to the site.
When the repository already has a deploy file
The drawer compares your choices with the file in the repository and shows what would change. Nothing changes until you download the new file and commit it.
For a repository you push to directly, Save on the server writes the file into the server's copy, but only when it has none. Commit it there over SSH before you deploy. Repositories cloned from GitHub or GitLab don't offer Save on the server, because the server's copy only pulls. Download the file and commit it in the original repository instead.
Restore points
When you tick Note the latest restore point before each deploy, each deploy in the history shows the newest backup of that site. If a deploy goes wrong, that tells you which backup to restore. See Backups overview.
If something goes wrong
| Problem | Fix |
|---|---|
| The repository still shows Set up deploys | The file isn't at the top level, was renamed, or isn't committed yet |
| A deploy fails at the Composer step | Open Log. Memory errors mean the install is too big for your plan. See Use Composer |
| Files you uploaded by hand disappeared | Remove files on the site that aren't in the repository was on. Restore them from a backup and turn it off |
Still stuck? Ask us and we'll walk you through it.
