Download the PHP package innocenzi/deployer-recipe-forge without Composer
On this page you can find all versions of the php package innocenzi/deployer-recipe-forge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download innocenzi/deployer-recipe-forge
More information about innocenzi/deployer-recipe-forge
Files in innocenzi/deployer-recipe-forge
Download innocenzi/deployer-recipe-forge
More information about innocenzi/deployer-recipe-forge
Files in innocenzi/deployer-recipe-forge
Vendor innocenzi
Package deployer-recipe-forge
Short Description Seamless zero-downtime deployment on Forge with Deployer
License MIT
Homepage https://github.com/innocenzi/deployer-recipe-forge
Package deployer-recipe-forge
Short Description Seamless zero-downtime deployment on Forge with Deployer
License MIT
Homepage https://github.com/innocenzi/deployer-recipe-forge
Please rate this library. Is it a good library?
Informations about the package deployer-recipe-forge
Forge recipe for Deployer
Seamless zero-downtime deployment on Forge with Deployer
# About `deployer-recipe-forge` is a recipe for [Deployer](https://deployer.org/) that helps implementing zero-downtime on [Laravel Forge](https://forge.laravel.com/servers). It uses [Forge's API](https://forge.laravel.com/api-documentation) to fetch a site's credentials, such as its IP address and the remote username, so you don't have to hardcode them in your `deploy.php`. It automatically finds the right Forge site using your repository's name, so the only configuration to do happens on Forge. Additionally, it's able to send notifications on Slack with either [Deployer's integration](https://deployer.org/docs/7.x/contrib/slack), which requires that you setup a webhook, or by pinging [Forge's deployment URL](https://forge.laravel.com/docs/sites/deployments.html#using-deployment-triggers). # Installation Install the package as a development dependency: Then, create a `deploy.php` file at the root of your project. [Import the autoloader](https://github.com/deployphp/deployer/issues/3605), and call `\Deployer\Forge::make()->configure();`. You may then customize your deployment script as usual with Deployer. # Usage ## Setting up the repository This recipe is designed to be used within a GitHub workflow, using the [action provided by Deployer](https://github.com/deployphp/action). Setting it up requires at least two [repository secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository): - Your server's _private_ SSH key, which will be used by `deployphp/action` to SSH - Your [Forge API token](https://forge.laravel.com/docs/accounts/api.html), which will be used by the recipe to fetch your site and server's credentials These repository secrets must then be forwarded to the action as environment variables, or, for the SSH key, as the `private-key` argument: > [!WARNING] > Note that the `REPOSITORY_BRANCH` and `REPOSITORY_NAME` variables are required for the recipe to work, since they are used to match your site and branch to your site Forge. > [!NOTE] > For convenience, if you are using a paid GitHub plan, you may setup your Forge API token and Slack webhook as [organization-wide secrets](https://docs.github.com/en/codespaces/managing-codespaces-for-your-organization/managing-secrets-for-your-repository-and-organization-for-github-codespaces#adding-secrets-for-an-organization). ## Setting up Forge ### Creating a new site The following steps explain how to setup a new site on Forge to work with this recipe on GitHub Actions. 1. Create an [isolated](https://forge.laravel.com/docs/sites/user-isolation.html#overview) site. > Currently, this recipe only works with isolated Forge sites. You must then create an isolated site. 2. Install the repository using the [GitHub integration](https://forge.laravel.com/docs/sites/the-basics.html#git-repository). > You may uncheck "install composer dependencies" to make the installation faster, as the site directory will be erased anyway.composer require --dev innocenzi/deployer-recipe-forge
> If you haven't [associated the server's deploy key with your GitHub repository](https://forge.laravel.com/docs/servers/ssh.html#server-ssh-key-git-project-access), make sure that you do or that you [create a deploy key for this site](https://forge.laravel.com/docs/servers/ssh.html#deploy-keys). 3. If necessary, add the server's public key (`~/.ssh/id_rsa.pub`) to the [repository's deploy keys](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/managing-deploy-keys#deploy-keys). > This will allow Deployer to clone the repository from its SSH session on the server. 4. SSH into the server to copy its public key (`~/.ssh/id_rsa.pub`) and add it to the [server's authorized keys](https://forge.laravel.com/docs/accounts/ssh.html#adding-ssh-key-to-existing-servers) on Forge. > This is the first step to allow the Deployer action to SSH into the server.
> The key should be associated to the correct isolated site username. 5. Finally, copy the server's private key (`~/.ssh/id_rsa`) and add it to the [repository's secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository). > This is the last step to allow the Deployer action to SSH into the server.
> We suggest naming the secret after the target environment. For instance, if you are creating a staging site, it may be named `STAGING_SSH_KEY`. 6. You may then trigger the deployment workflow. ### Adding to an existing site First, make sure the website is isolated. It must be located at `/home/
All versions of deployer-recipe-forge with dependencies
PHP Build Version
Package Version
The package innocenzi/deployer-recipe-forge contains the following files
Loading the files please wait ....