Automatic deployments - Laravel Bitbucket Repo > Larasail > Digital Ocean
I have a Laravel website (repo in Bitbucket) deployed to a Digital Ocean droplet that I setup using Larasail (https://github.com/thedevdojo/larasail).
Every time I push code to Bitbucket, I want it to be deployed to Digital Ocean automatically.
What is the best way to achieve this?
I previously used Laravel Forge but would like to try and avoid the monthly cost.
Hi there,
I've not done this with bitbucket, but with GitHub using the following package:
https://github.com/deployphp/deployer
With bitbucket this should be achievable using their Pieplens. I had a similar discussion here:
As a side note is there a specific reason why you prefer bitbucket rather than GitHub?
Best,
Bobby
Thanks I will take a look at deployer.
From having a quick look, I guess I don't need deployer to provision as I am using larasail for that, its just the deployment aspect. Or may be it would be easier to do everything via deployer.
As for bitbucket/github - I think I use bitbucket because years ago you couldn't have free private repos on github. However I do have an account and see you can easily move repos from bitbucket to github, so I could easily change.
Thanks,
Hi there,
Ah yes I remember that time too. I used to use GitLab for the exact same reason but moved to GitHub a year or so ago.
There is a Deployer package for Laravel too which might be helpful:
Thanks for the link.
This article seems to be exactly what I am looking for: https://lorisleiva.com/deploy-your-laravel-app-from-scratch/install-and-configure-deployer
Do you use Deployer? What do you use to run Laravel on your local machine out of interest? I am using Laragon (old school!) and it doesn't look like deployer will work. I get 'dep' is not recognised in my terminal.
Chris.
Hey Chris,
What I've been doing recently is to use a small $5/mo remote server for my dev work. I basically setup the whole server using LaraSail then with VS Code there is that extension called Remote SSH, which let's you connect to your server over SSH directly via VS Code and it is just like editing files locally.
Kind of an odd apraoch but it's nice that I have my dev projects up and running all the time and I can access them via my different laptops/PCs. Also it is nice to have identical dev and prod environments.
Also, I've used deployer a few months ago together with LaraSail, I remember that it worked almost out of the box with some minor configuration changes.