Skip to content

Commit

Permalink
support for adding secrets to deployment (superfly#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksrandall authored Sep 13, 2022
1 parent c93b4be commit 5d5f1c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ inputs:
update:
description: Whether new commits to the PR should re-deploy the Fly app
default: true
secrets:
description: Secrets to be set on the app. Separate multiple secrets with a space, i.e., `FIRST_SECRET=${{ secrets.FIRST_SECRET }} SECOND_SECRET=${{ secrets.SECOND_SECRET }}`
6 changes: 5 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ fi

# Deploy the Fly app, creating it first if needed.
if ! flyctl status --app "$app"; then
flyctl launch --now --copy-config --name "$app" --image "$image" --region "$region" --org "$org"
flyctl launch --no-deploy --copy-config --name "$app" --image "$image" --region "$region" --org "$org"
if [ -n "$INPUT_SECRETS" ]; then
echo $INPUT_SECRETS | tr " " "\n" | flyctl secrets import --app "$app"
fi
flyctl deploy --app "$app" --region "$region" --image "$image" --region "$region" --strategy immediate
elif [ "$INPUT_UPDATE" != "false" ]; then
flyctl deploy --config "$config" --app "$app" --region "$region" --image "$image" --region "$region" --strategy immediate
fi
Expand Down

0 comments on commit 5d5f1c2

Please sign in to comment.