2020-11-11 01:10:29 +00:00
|
|
|
# GitHub Action for Deployer
|
2020-11-10 22:49:10 +00:00
|
|
|
|
2024-06-19 20:44:47 +00:00
|
|
|
<p align="center"><sup>Special thanks to:</sup></p>
|
|
|
|
<a href="https://www.warp.dev/?utm_source=github&utm_medium=referral&utm_campaign=deployer_20240618">
|
|
|
|
<p align="center"><img src=".github/warp-logo@2x.png" alt="Warp"></p>
|
|
|
|
<p align="center">Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.</p>
|
|
|
|
<p align="center"><b>Visit warp.dev to learn more.</b></p>
|
|
|
|
</a>
|
|
|
|
|
2020-11-13 20:47:43 +00:00
|
|
|
```yaml
|
|
|
|
- name: Deploy
|
2021-10-15 21:07:42 +00:00
|
|
|
uses: deployphp/action@v1
|
2020-11-13 20:47:43 +00:00
|
|
|
with:
|
2021-10-15 21:07:42 +00:00
|
|
|
dep: deploy
|
2022-10-01 16:13:45 +00:00
|
|
|
private-key: ${{ secrets.PRIVATE_KEY }}
|
2020-11-13 20:47:43 +00:00
|
|
|
```
|
2020-11-13 20:45:33 +00:00
|
|
|
|
2020-11-13 20:47:43 +00:00
|
|
|
## Inputs
|
2020-11-13 20:45:33 +00:00
|
|
|
|
2021-10-21 20:08:17 +00:00
|
|
|
```yaml
|
|
|
|
- name: Deploy
|
|
|
|
uses: deployphp/action@v1
|
|
|
|
with:
|
|
|
|
# The deployer task to run. For example:
|
|
|
|
# `deploy all`.
|
|
|
|
# Required.
|
|
|
|
dep: deploy
|
2024-05-07 10:46:52 +00:00
|
|
|
|
|
|
|
# The path to the PHP binary to use.
|
|
|
|
# Optional.
|
|
|
|
php-binary: "php"
|
2023-02-01 11:26:35 +00:00
|
|
|
|
|
|
|
# Specifies a sub directory within the repository to deploy
|
|
|
|
# Optional
|
|
|
|
sub-directory: "..."
|
2023-01-10 14:46:25 +00:00
|
|
|
|
|
|
|
# Config options for the Deployer. Same as the `-o` flag in the CLI.
|
|
|
|
# Optional.
|
|
|
|
options:
|
|
|
|
keep_releases: 7
|
2023-01-10 13:47:26 +00:00
|
|
|
|
2022-10-01 16:13:45 +00:00
|
|
|
# Private key for connecting to remote hosts. To generate private key:
|
|
|
|
# `ssh-keygen -o -t rsa -C 'action@deployer.org'`.
|
|
|
|
# Optional.
|
|
|
|
private-key: ${{ secrets.PRIVATE_KEY }}
|
|
|
|
|
2021-10-21 20:08:17 +00:00
|
|
|
# Content of `~/.ssh/known_hosts` file. The public SSH keys for a
|
|
|
|
# host may be obtained using the utility `ssh-keyscan`.
|
|
|
|
# For example: `ssh-keyscan deployer.org`.
|
|
|
|
# If known-hosts omitted, `StrictHostKeyChecking no` will be added to
|
|
|
|
# `ssh_config`.
|
|
|
|
# Optional.
|
|
|
|
known-hosts: |
|
|
|
|
...
|
|
|
|
|
|
|
|
# The SSH configuration. Content of `~/.ssh/config` file.
|
|
|
|
# Optional.
|
|
|
|
ssh-config: |
|
|
|
|
...
|
2023-01-10 14:46:25 +00:00
|
|
|
|
|
|
|
# Option to skip over the SSH setup/configuration.
|
|
|
|
# Self-hosted runners don't need the SSH configuration or the SSH agent
|
|
|
|
# to be started.
|
|
|
|
# Optional.
|
|
|
|
skip-ssh-setup: false
|
2021-10-21 20:08:17 +00:00
|
|
|
|
|
|
|
# Deployer version to download from deployer.org.
|
|
|
|
# First, the action will check for Deployer binary at those paths:
|
2022-03-19 17:21:46 +00:00
|
|
|
# - `vendor/bin/deployer.phar`
|
2021-10-21 20:08:17 +00:00
|
|
|
# - `vendor/bin/dep`
|
|
|
|
# - `deployer.phar`
|
|
|
|
# If the binary not found, phar version will be downloaded from
|
|
|
|
# deployer.org.
|
|
|
|
# Optional.
|
|
|
|
deployer-version: "7.0.0"
|
|
|
|
|
|
|
|
# You can specify path to your local Deployer binary in the repo.
|
|
|
|
# Optional.
|
|
|
|
deployer-binary: "bin/dep"
|
2022-08-17 13:46:44 +00:00
|
|
|
|
|
|
|
# You can choose to disable ANSI output.
|
|
|
|
# Optional. Defaults to true.
|
|
|
|
ansi: false
|
|
|
|
|
|
|
|
# You can specify the output verbosity level.
|
|
|
|
# Optional. Defaults to -v.
|
|
|
|
verbosity: -vvv
|
2021-10-21 20:08:17 +00:00
|
|
|
```
|
2020-11-13 20:45:33 +00:00
|
|
|
|
2020-11-10 22:49:10 +00:00
|
|
|
## Example
|
|
|
|
|
|
|
|
```yaml
|
2021-10-21 20:08:17 +00:00
|
|
|
name: deploy
|
|
|
|
|
|
|
|
on: push
|
|
|
|
|
|
|
|
# It is important to specify "concurrency" for the workflow,
|
|
|
|
# to prevent concurrency between different deploys.
|
|
|
|
concurrency: production_environment
|
|
|
|
|
2021-10-15 21:07:42 +00:00
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
2023-02-07 06:36:22 +00:00
|
|
|
php-version: '8.1'
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: composer install
|
2021-10-15 21:07:42 +00:00
|
|
|
|
|
|
|
- name: Deploy
|
|
|
|
uses: deployphp/action@v1
|
|
|
|
with:
|
|
|
|
dep: deploy
|
2022-10-01 16:13:45 +00:00
|
|
|
private-key: ${{ secrets.PRIVATE_KEY }}
|
2020-11-10 22:49:10 +00:00
|
|
|
```
|