From 18d067dad8801cb62b494a6b1240477262acd3b4 Mon Sep 17 00:00:00 2001 From: Samuel Felipe Date: Wed, 1 Feb 2023 05:42:46 -0300 Subject: [PATCH] Add support to subdirectories --- README.md | 3 +++ action.yaml | 5 +++++ index.js | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/README.md b/README.md index 1f697a8..0622496 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,9 @@ # `deploy all`. # Required. 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. # Optional. diff --git a/action.yaml b/action.yaml index 2e07c45..74aadcb 100644 --- a/action.yaml +++ b/action.yaml @@ -8,6 +8,11 @@ inputs: required: true description: The command. + sub-directory: + required: false + default: '' + description: Specifies a sub directory within the repository to deploy. + options: required: false default: '' diff --git a/index.js b/index.js index c7c7456..cd2c640 100644 --- a/index.js +++ b/index.js @@ -52,6 +52,11 @@ async function ssh() { async function dep() { let dep = core.getInput('deployer-binary') + let subDirectory = core.getInput('sub-directory').trim() + + if (subDirectory !== '') { + cd(subDirectory) + } if (dep === '') for (let c of ['vendor/bin/deployer.phar', 'vendor/bin/dep', 'deployer.phar']) {