Set up GitHub Actions to handle deployments for your Laravel application. This has similar functionality to Laravel Forge without the recurring cost. GitHub Actions can be used to automate your deployment process on every push to your repository.
- Server Access: Ensure you have SSH access to your server where the Laravel app will be deployed.
- Secrets: Store sensitive information such as your server's IP address, SSH username, and private SSH key in GitHub Secrets. Go to your GitHub repository, navigate to "Settings" > "Secrets and variables" > "Actions", and add the following secrets:
DEPLOY_SERVER_IP
: Your server's IP address.DEPLOY_SERVER_USER
: Your SSH username.DEPLOY_SERVER_KEY
: Your private SSH key. Make sure this key is authorized to access your server (~/.ssh/authorized_keys
).