diff --git a/README.md b/README.md index 20469b2..b13ae7b 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Laravel (All Properties) Example s3_folder: production excluded_files: '.git/* .env storage/framework/cache/* node_modules/*' max_polling_iterations: 60 + directory: ./ ``` Laravel (Only Required) Example @@ -57,6 +58,7 @@ Following inputs can be used as `step.with` keys | `s3_bucket` | Yes | String | S3 Bucket for archive to be uploaded. | | `s3_folder` | Yes | String | S3 Folder for archive to be uploaded within bucket. | | `excluded_files` | No | String | Space delimited list of patterns to exclude from archive | +| `directory` | No | String | Directory to archive. Defaults to root of project. | | `max_polling_iterations` | No | Number | Number of 15s iterations to poll max. (default: `60`) | ## IAM Permissions diff --git a/deploy.sh b/deploy.sh index 86ea99e..a0d5a67 100755 --- a/deploy.sh +++ b/deploy.sh @@ -58,7 +58,11 @@ echo "$INPUT_EXCLUDED_FILES" | tr ' ' '\n' > "$EXCLUSION_FILE" echo "::debug::Exclusion file created for files to ignore in Zip Generation." -zip -r --quiet "$ZIP_FILENAME" "$DIR_TO_ZIP" -x "@$EXCLUSION_FILE" +if [ -n "$DIR_TO_ZIP" ]; then + cd "$DIR_TO_ZIP"; +fi + +zip -r --quiet "$ZIP_FILENAME" . -x "@$EXCLUSION_FILE" if [ ! -f "$ZIP_FILENAME" ]; then echo "::error::$ZIP_FILENAME was not generated properly (zip generation failed)." exit 1;