Skip to content

Commit

Permalink
Fix Phoenix App Deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
tgautier committed Aug 19, 2024
1 parent 6f79ec3 commit 2ed0430
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,21 @@ 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 --remote-only --copy-config --name "$app" --image "$image" --region "$region" --org "$org"
flyctl apps create "$app" --org "$org" --verbose
# Restore the original config file
cp "$config.bak" "$config"
fi
if [ -n "$INPUT_SECRETS" ]; then
echo $INPUT_SECRETS | tr " " "\n" | flyctl secrets import --app "$app"
fi

# Attach postgres cluster to the app if specified.
if [ -n "$INPUT_POSTGRES" ]; then
flyctl postgres attach "$INPUT_POSTGRES" --app "$app" || true
fi

# Trigger the deploy of the new version.
echo "Contents of config $config file: " && cat "$config"
if [ -n "$INPUT_VM" ]; then
flyctl deploy --config "$config" --app "$app" --regions "$region" --image "$image" --strategy immediate --ha=$INPUT_HA --vm-size "$INPUT_VMSIZE"
flyctl deploy --remote-only --config "$config" --app "$app" --regions "$region" --strategy immediate --ha=$INPUT_HA --vm-size "$INPUT_VMSIZE"
else
flyctl deploy --config "$config" --app "$app" --regions "$region" --image "$image" --strategy immediate --ha=$INPUT_HA --vm-cpu-kind "$INPUT_CPUKIND" --vm-cpus $INPUT_CPU --vm-memory "$INPUT_MEMORY"
flyctl deploy --remote-only --config "$config" --app "$app" --regions "$region" --strategy immediate --ha=$INPUT_HA --vm-cpu-kind "$INPUT_CPUKIND" --vm-cpus $INPUT_CPU --vm-memory "$INPUT_MEMORY"
fi

# Make some info available to the GitHub workflow.
Expand Down

0 comments on commit 2ed0430

Please sign in to comment.