diff --git a/README.md b/README.md index 744a1f2..8a8c7f0 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,10 @@ If you have an existing `fly.toml` in your repo, this action will copy it with a ## Inputs | name | description | -| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `name` | The name of the Fly app. Alternatively, set the env `FLY_APP`. For safety, must include the PR number. Example: `myapp-pr-${{ github.event.number }}`. Defaults to `pr-{number}-{repo_org}-{repo_name}`. | +| `image` | Optional pre-existing Docker image to use | +| `config` | Optional path to a custom Fly toml config. Config path should be relative to `path` parameter, if specified. | | `region` | Which Fly region to run the app in. Alternatively, set the env `FLY_REGION`. Defaults to `iad`. | | `org` | Which Fly organization to launch the app under. Alternatively, set the env `FLY_ORG`. Defaults to `personal`. | | `path` | Path to run the `flyctl` commands from. Useful if you have an existing `fly.toml` in a subdirectory. | diff --git a/action.yml b/action.yml index 44d6411..cfc482d 100644 --- a/action.yml +++ b/action.yml @@ -12,6 +12,8 @@ inputs: description: Fly app name image: description: Optional pre-existing Docker image to use + config: + description: Optional path to a custom Fly toml config. Config path should be relative to `path` parameter, if specified. region: description: Region to launch the app in (alternatively, set the env FLY_REGION) org: diff --git a/entrypoint.sh b/entrypoint.sh index c092e2a..49a7313 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -22,6 +22,7 @@ app="${INPUT_NAME:-pr-$PR_NUMBER-$REPO_OWNER-$REPO_NAME}" region="${INPUT_REGION:-${FLY_REGION:-iad}}" org="${INPUT_ORG:-${FLY_ORG:-personal}}" image="$INPUT_IMAGE" +config="$INPUT_CONFIG" if ! echo "$app" | grep "$PR_NUMBER"; then echo "For safety, this action requires the app's name to contain the PR number." @@ -38,7 +39,7 @@ fi if ! flyctl status --app "$app"; then flyctl launch --now --copy-config --name "$app" --image "$image" --region "$region" --org "$org" elif [ "$INPUT_UPDATE" != "false" ]; then - flyctl deploy --app "$app" --region "$region" --image "$image" --region "$region" --strategy immediate + flyctl deploy --config "$config" --app "$app" --region "$region" --image "$image" --region "$region" --strategy immediate fi # Attach postgres cluster to the app if specified.