Deploy Laravel for GitHub Actions
View on GitHub

Step 9: File permissions

We have to make sure that your project has file permissions configured correctly.

Is the user that deploys your code the same user that serves web requests?

For example: user "sjorso" runs deployments, but user "www-data" serves web requests.

For example: your server is provisioned by Laravel Forge and the user "forge" is used for everything.

(select an option above)

Because you are using two different users you'll have to make some changes to prevent file permissions errors.

Note: making these changes is optional, but if you choose to skip it you might run into file permission errors in the future. You can stop the deployment script from setting file permissions by commenting out the "set-file-permissions" hook in "deploy.sh".

Are you deploying a new project or an existing project?

You haven't deployed this project before. Your "base_directory" is empty.

You have deployed this project before using a different way of deploying.

(select an option above)

The deployment script will set correct file permissions automatically. There are two things you have to make sure:

  1. The user that runs your deployments is in the same group as the user that serves your web requests.
  2. You have set default file permissions in your filesystems.php config file.

How to do both these things is explained in this detailed guide on how to set up file permissions. You only have to follow the steps for the user group, and the filesystems.php config file. The other steps will be handled by the deployment script automatically.

Once you're done, you can continue to the next step.

The deployment script will always check if file permissions are set correctly. If they aren't, the script will fail gracefully with a helpful error message.

You'll have to make some changes to prevent file permission errors. Click here for a detailed guide on how to set up file permissions.

You only have to follow this guide for this project once. After that, the deployment script will set file permissions automatically.

Once you're done, you can continue to the next step.

The deployment script will always check if file permissions are set correctly. If they aren't, the script will fail gracefully with a helpful error message.

No changes are required if you use a single user. You can continue to the next step.