Skip to content

Commit

Permalink
Added Option to save files in dist folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
varunsridharan committed Jun 5, 2020
1 parent f2f8663 commit ce77040
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -34,3 +37,4 @@ runs:
- ${{ inputs.EXCLUDE_LIST }}
- ${{ inputs.ASSETS_PATH }}
- ${{ inputs.ASSETS_EXCLUDE_LIST }}
- ${{ inputs.DIST_LOCATION }}
10 changes: 10 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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#*/}
Expand All @@ -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 " "
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ce77040

Please sign in to comment.