diff --git a/README.md b/README.md index 04f6d4e..517168f 100644 --- a/README.md +++ b/README.md @@ -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 @@ -90,6 +91,8 @@ jobs: - name: Deploy app id: deploy uses: superfly/fly-pr-review-apps@1.0.0 + with: + dockerfile: "./Dockerfile" - name: Clean up GitHub environment uses: strumwolf/delete-deployment-environment@v2 diff --git a/action.yml b/action.yml index 0748d75..06e59a4 100644 --- a/action.yml +++ b/action.yml @@ -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 diff --git a/entrypoint.sh b/entrypoint.sh index 1ec9f5c..3fd40b6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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." @@ -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