Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
# `deploy all`.
# Required.
dep: deploy

# The path to the PHP binary to use.
# Optional.
php-binary: "php"

# 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:
Expand All @@ -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`
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
dep:
required: true
description: The command.

php-binary:
required: false
default: ''
Expand Down Expand Up @@ -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'
Expand Down
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
}
Expand Down