mirror of
https://github.com/deployphp/action.git
synced 2025-07-18 21:35:16 +00:00
Merge e1198c3769
into f60b28c08a
This commit is contained in:
commit
703868bf6c
3 changed files with 19 additions and 7 deletions
12
README.md
12
README.md
|
@ -18,7 +18,7 @@
|
|||
# `deploy all`.
|
||||
# Required.
|
||||
dep: deploy
|
||||
|
||||
|
||||
# The path to the PHP binary to use.
|
||||
# Optional.
|
||||
php-binary: "php"
|
||||
|
@ -26,7 +26,7 @@
|
|||
# Specifies a sub directory within the repository to deploy
|
||||
# Optional
|
||||
sub-directory: "..."
|
||||
|
||||
|
||||
# Config options for the Deployer. Same as the `-o` flag in the CLI.
|
||||
# Optional.
|
||||
options:
|
||||
|
@ -50,13 +50,13 @@
|
|||
# Optional.
|
||||
ssh-config: |
|
||||
...
|
||||
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
# Deployer version to download from deployer.org.
|
||||
# First, the action will check for Deployer binary at those paths:
|
||||
# - `vendor/bin/deployer.phar`
|
||||
|
@ -78,6 +78,10 @@
|
|||
# You can specify the output verbosity level.
|
||||
# Optional. Defaults to -v.
|
||||
verbosity: -vvv
|
||||
|
||||
# The branch to deploy. Adds --branch=value to the deploy command.
|
||||
# Optional.
|
||||
branch: "main"
|
||||
```
|
||||
|
||||
## Example
|
||||
|
|
|
@ -7,7 +7,7 @@ inputs:
|
|||
dep:
|
||||
required: true
|
||||
description: The command.
|
||||
|
||||
|
||||
php-binary:
|
||||
required: false
|
||||
default: ''
|
||||
|
@ -68,6 +68,11 @@ inputs:
|
|||
default: '-v'
|
||||
description: Verbosity level Can be -v, -vv or -vvv.
|
||||
|
||||
branch:
|
||||
required: false
|
||||
default: ''
|
||||
description: The branch to deploy.
|
||||
|
||||
runs:
|
||||
using: 'node20'
|
||||
main: 'index.js'
|
||||
|
|
7
index.js
7
index.js
|
@ -124,15 +124,18 @@ async function dep() {
|
|||
} catch (e) {
|
||||
console.error('Invalid JSON in options')
|
||||
}
|
||||
|
||||
|
||||
let phpBin = 'php'
|
||||
let phpBinArg = core.getInput('php-binary');
|
||||
if (phpBinArg !== '') {
|
||||
phpBin = phpBinArg
|
||||
}
|
||||
|
||||
let branch = core.getInput('branch')
|
||||
let branchOption = branch !== '' ? `--branch=${branch}` : ''
|
||||
|
||||
try {
|
||||
await $`${phpBin} ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}`
|
||||
await $`${phpBin} ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options} ${branchOption}`
|
||||
} catch (err) {
|
||||
core.setFailed(`Failed: dep ${cmd}`)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue