diff --git a/action.yml b/action.yml index 20a9c6c..b2e99c5 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ -name: "GitHub Action for flyctl" -description: "Wraps the flyctl CLI tool to enable deploying and managing Fly apps" +name: "GitHub Action for deplying staging apps on fly.io" +description: "Wraps the flyctl CLI tool to enable managing temporary staging apps on Fly" author: Fly branding: icon: "upload-cloud" @@ -7,3 +7,19 @@ branding: runs: using: "docker" image: "Dockerfile" +inputs: + action: + description: create, deploy, or destroy + app-prefix: + description: App name that will be suffixed with e.g. *-pr123 based on the PR + required: true + image: + description: Optional pre-existing Docker image to use + region: + description: Region to launch the app in (alternatively, set the env FLY_REGION) + org: + description: Organization to launch the app in (alternatively, set the env FLY_ORG) + path: + description: path to a directory with a pre-existing fly.toml which will be copied + postgres: + description: Optionally attach the app to a pre-existing postgres cluster on Fly diff --git a/entrypoint.sh b/entrypoint.sh index d16eba5..0829bd7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,11 +1,20 @@ #!/bin/sh -l -if [ -n "$FLY_PROJECT_PATH" ]; then +if [ -n "$INPUT_PATH" ]; then PREV_PATH=$(pwd) # Allow user to change directories in which to run Fly commands - cd "$FLY_PROJECT_PATH" || exit + cd "$INPUT_PATH" || exit fi -sh -c "flyctl $*" + +PR_NUMBER=$(echo "$GITHUB_REF" | awk 'BEGIN { FS = "/" } ; { print $3 }') + +echo "PR_NUMBER: $PR_NUMBER" +echo "app: $INPUT_APP_PREFIX-pr$PR_NUMBER" + +env + +echo "workflow/event.json:" +cat workflow/event.json ACTUAL_EXIT="$?"