Skip to content
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ If you have an existing `fly.toml` in your repo, this action will copy it with a
| `cpukind` | Set app VM CPU kind - shared or performance. Default shared. |
| `memory` | Set app VM memory in megabytes. Default 256. |
| `ha` | Create spare machines that increases app availability. Default `false`. |
| `dockerfile` | Path to a Dockerfile, that will be used for building the image |

## Required Secrets

Expand Down Expand Up @@ -90,6 +91,8 @@ jobs:
- name: Deploy app
id: deploy
uses: superfly/[email protected]
with:
dockerfile: "./Dockerfile"

- name: Clean up GitHub environment
uses: strumwolf/delete-deployment-environment@v2
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ inputs:
ha:
description: Create spare machines that increases app availability (default false)
default: false
dockerfile:
description: Path to a Dockerfile, will be used for building the image
required: true
3 changes: 2 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ region="${INPUT_REGION:-${FLY_REGION:-iad}}"
org="${INPUT_ORG:-${FLY_ORG:-personal}}"
image="$INPUT_IMAGE"
config="${INPUT_CONFIG:-fly.toml}"
dockerfile="$INPUT_DOCKERFILE"

if ! echo "$app" | grep "$PR_NUMBER"; then
echo "For safety, this action requires the app's name to contain the PR number."
Expand All @@ -40,7 +41,7 @@ fi
if ! flyctl status --app "$app"; then
# Backup the original config file since 'flyctl launch' messes up the [build.args] section
cp "$config" "$config.bak"
flyctl launch --no-deploy --copy-config --name "$app" --image "$image" --region "$region" --org "$org"
flyctl launch --no-deploy --copy-config --name "$app" --dockerfile "$dockerfile" --image "$image" --region "$region" --org "$org"
# Restore the original config file
cp "$config.bak" "$config"
fi
Expand Down