diff --git a/entrypoint.sh b/entrypoint.sh index f16a75c..de736bb 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -70,9 +70,11 @@ fi # Trigger the deploy of the new version. echo "Contents of config $config file: " && cat "$config" -if [ -n "$INPUT_VM" ]; then +if [ -n "$INPUT_VMSIZE" ]; then + fly machines destroy --force --app "$app" $(fly machines list --app "$app" --json | jq -r '[.[].id] | join(" ")') flyctl deploy --config "$config" --app "$app" --regions "$region" --image "$image" --strategy immediate --ha=$INPUT_HA ${build_args} ${build_secrets} --vm-size "$INPUT_VMSIZE" else + fly machines destroy --force --app "$app" $(fly machines list --app "$app" --json | jq -r '[.[].id] | join(" ")') flyctl deploy --config "$config" --app "$app" --regions "$region" --image "$image" --strategy immediate --ha=$INPUT_HA ${build_args} ${build_secrets} --vm-cpu-kind "$INPUT_CPUKIND" --vm-cpus $INPUT_CPU --vm-memory "$INPUT_MEMORY" fi