diff --git a/action.yml b/action.yml index 4bcf59a..ffd9d92 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,9 @@ inputs: ASSETS_EXCLUDE_LIST: description: 'Add file / folders that you wish to exclude from final list of files to be sent to ftp. Eg development files. Final value of this var is expected to be a string delimited with spaces. Eg: ".gitignore package.json README.md" Please Note, excluded file/folder path, is considered from the root of repository unless CUSTOM_PATH is provided, in which case excluded file/folder path should be relative to the final source of files.' default: '' + DIST_LOCATION: + description: 'Provide a path here final zip file can be stored. which can be used by other actions.' + default: 'dist/' runs: using: 'docker' @@ -34,3 +37,4 @@ runs: - ${{ inputs.EXCLUDE_LIST }} - ${{ inputs.ASSETS_PATH }} - ${{ inputs.ASSETS_EXCLUDE_LIST }} + - ${{ inputs.DIST_LOCATION }} diff --git a/entrypoint.sh b/entrypoint.sh index ca31e7d..89429ff 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,6 +7,7 @@ CUSTOM_COMMAND="${INPUT_CUSTOM_COMMAND}" EXCLUDE_LIST="${INPUT_EXCLUDE_LIST}" ASSETS_PATH="${INPUT_ASSETS_PATH}" ASSETS_EXCLUDE_LIST="${INPUT_ASSETS_EXCLUDE_LIST}" +DIST_LOCATION="${INPUT_DIST_LOCATION}" # Allow some ENV variables to be customized SLUG=${GITHUB_REPOSITORY#*/} @@ -18,6 +19,10 @@ if [[ $VERSION == $GITHUB_REF ]]; then VERSION=${GITHUB_REF#refs/heads/} fi +if [[ -z "$DIST_LOCATION" ]]; then + DIST_LOCATION="dist/" +fi + # Custom Command Option if [[ ! -z "$CUSTOM_COMMAND" ]]; then echo " " @@ -92,6 +97,11 @@ cd ../envato-final-source && ls -lah echo "##[endgroup]" echo "👌 FTP Deploy Complete" +echo "##[group] 📦 Copying To Dist Folder" +mkdir "$GITHUB_WORKSPACE/$DIST_LOCATION" +cp -r ../envato-final-source/* "$GITHUB_WORKSPACE/$DIST_LOCATION" +echo "##[endgroup]" + rm -r ../envato-draft-source/ rm -r ../envato-draft-source-assets rm -r ../envato-draft-source-screenshots