This action is geared toward the deployment steps for installing a Laravel application to a VM-based application server. An artifact in the form of a tarball must be created in a worklow prior to using this action. This action is only intended to run on a self-hosted runner. Also, unlike the Bamboo-based deployments, this action does not attempt to deal with application storage (e.g. logs, cache, files). It is recommended that a storage directory be created outside the versions root on the VM and the application configured to redirect all storage to that location.
Required The username under which to execute SCP/SSH operations.
Required The hostname of the VM to which to deploy the code.
Required The path to the deployment directories. Example: /www/vhosts/{domain}/versions
The name of the version to deploy. Default: sha value of the commit triggering the workflow.
A pipe-delimited list of artisan commands to run after the deployment. Example: clear-compiled|migrate|optimize
A pipe-delimited list of paths relative to the application root that need to be writable by the web server. Example: storage
for Laravel, application/cache|application/logs
for Kohana.
The path to the deployable tarball. Default: ./artifact.tar.gz
The number of versions to keep on the target VM. The most recent number of configured versions will be kept.
All others will be removed. The default behavior is to not remove anything. This can also be achieved with
an explicit value of "0"
A pipe-delimited list of commands to run after the deployment. These will be run in the directory to which the code was deployed.
uses: brownuniversity/laravel-vm-deployment-action@v3
with:
user: "cibot"
host: "appserver.services.brown.edu"
versionsRoot: "/www/vhosts/appserver.services.brown.edu/versions"
version:"v1.0.0"
artisanCommands: "config:cache|migrate"
postDeploymentCommands: "sudo supervisorctl restart foo-worker"
writableDirectories: "storage"
artifact: "some-other-tarball.tar.gz"
numberOfVersionsToKeep: 5
Be sure to run make compile
and commit the changes to the resultant dist/index.js
file prior to tagging a new release.