Add support to subdirectories

This commit is contained in:
Samuel Felipe 2023-02-01 05:42:46 -03:00
parent e71b9feeeb
commit 18d067dad8
3 changed files with 13 additions and 0 deletions

View file

@ -18,6 +18,9 @@
# `deploy all`. # `deploy all`.
# Required. # Required.
dep: deploy dep: deploy
# Specifies a sub directory within the repository to deploy
sub-directory: "..."
# Config options for the Deployer. Same as the `-o` flag in the CLI. # Config options for the Deployer. Same as the `-o` flag in the CLI.
# Optional. # Optional.

View file

@ -8,6 +8,11 @@ inputs:
required: true required: true
description: The command. description: The command.
sub-directory:
required: false
default: ''
description: Specifies a sub directory within the repository to deploy.
options: options:
required: false required: false
default: '' default: ''

View file

@ -52,6 +52,11 @@ async function ssh() {
async function dep() { async function dep() {
let dep = core.getInput('deployer-binary') let dep = core.getInput('deployer-binary')
let subDirectory = core.getInput('sub-directory').trim()
if (subDirectory !== '') {
cd(subDirectory)
}
if (dep === '') if (dep === '')
for (let c of ['vendor/bin/deployer.phar', 'vendor/bin/dep', 'deployer.phar']) { for (let c of ['vendor/bin/deployer.phar', 'vendor/bin/dep', 'deployer.phar']) {