All posts
Published in Latest Articles

Deploy Symfony 6 App On Digital Ocean Droplet

Profile image of Atakan Demircioğlu
By Atakan Demircioğlu
Fullstack Developer

Notes about deploying Symfony applications with Github actions in a droplet.

Deploy Symfony 6 App On Digital Ocean Droplet image 1

Prerequisites:

Add these lines to the Nginx configuration:

root /var/www/project/public; 
  
location / {  
    try_files $uri /index.php$is_args$args; 


location /bundles {  
  try_files $uri =404; 
}                      

For more information visit here.

For deploying automatically in the droplet, configure a GitHub action.

Also, you need to add secrets to actions under your repository settings.

In the script part, you can add or remove lines about your needs.

For example, you can add additional commands.

php bin/console cache:clear # For clearing caches 
php bin/console doctrine:migrations:migrate # for migration db 
composer install --no-dev --optimize-autoloader # for packages ...