Skip to content

Commit

Permalink
Merge pull request #23 from tobocop2/update-action-to-work-with-lates…
Browse files Browse the repository at this point in the history
…t-amplify

Fix publishing issue with latest amplify
  • Loading branch information
ambientlight authored May 8, 2021
2 parents 60165d3 + 566598b commit 78eaa2f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10
FROM node:lts

LABEL "com.github.actions.name"="GitHub action for deploying AWS Amplify project"
LABEL "com.github.actions.description"="This action builds and deploys your AWS Amplify project"
Expand Down
15 changes: 10 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [ -n "$1" ] ; then
cd "$1"
fi

# if amplify if available at path and custom amplify version is unspecified, do nothing,
# if amplify if available at path and custom amplify version is unspecified, do nothing,
# otherwise install globally latest npm version
# FIXME: weird: using local dep amplify-cli bugs with awscloudformation provider: with using provider underfined
if [ -z $(which amplify) ] || [ -n "$8" ] ; then
Expand All @@ -36,7 +36,7 @@ if [ -z $(which amplify) ] || [ -n "$8" ] ; then
# elif [ ! -f ./node_modules/.bin/amplify ] ; then
else
echo "using amplify available at PATH"
# else
# else
# echo "using local project dependency amplify"
# PATH="$PATH:$(pwd)/node_modules/.bin"
fi
Expand All @@ -59,17 +59,22 @@ case $5 in
;;

configure)
aws_config_file_path="$(pwd)/aws_config_file_path.json"
echo '{"accessKeyId":"'$AWS_ACCESS_KEY_ID'","secretAccessKey":"'$AWS_SECRET_ACCESS_KEY'","region":"'$AWS_REGION'"}' > $aws_config_file_path
echo '{"projectPath": "'"$(pwd)"'","defaultEditor":"code","envName":"'$6'"}' > ./amplify/.config/local-env-info.json
echo '{"'$6'":{"configLevel":"project","useProfile":false,"awsConfigFilePath":"'$aws_config_file_path'"}}' > ./amplify/.config/local-aws-info.json



# if environment doesn't exist fail explicitly
if [ -z "$(amplify env get --name $6 | grep 'No environment found')" ] ; then
if [ -z "$(amplify env get --name $6 | grep 'No environment found')" ] ; then
echo "found existing environment $6"
amplify env pull --yes $9
else
echo "$6 environment does not exist, consider using add_env command instead";
exit 1
fi

amplify status
;;

Expand Down Expand Up @@ -108,7 +113,7 @@ case $5 in
fi

# fill in dummy env in local-env-info so we delete current environment
# without switch to another one (amplify restriction)
# without switch to another one (amplify restriction)
echo '{"projectPath": "'"$(pwd)"'","defaultEditor":"code","envName":"dummyenvfordeletecurrentowork"}' > ./amplify/.config/local-env-info.json
echo "Y" | amplify env remove "$6" $9
;;
Expand Down

0 comments on commit 78eaa2f

Please sign in to comment.