Skip to content

Commit

Permalink
feat: add step to update the docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
som-matrix committed May 21, 2024
1 parent 6f79ec3 commit 29fa03a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ jobs:
- name: Deploy
id: deploy
uses: superfly/[email protected]

- name: Update docker image
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize' }}
run: flyctl image update -a pr-${{ github.event.number }}-myapp-app --skip-health-checks -y
```
## Cleaning up GitHub environments
Expand Down
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ if [ -n "$INPUT_POSTGRES" ]; then
flyctl postgres attach "$INPUT_POSTGRES" --app "$app" || true
fi

# Update docker image when subsequent commits are pushed to the PR.
if [ "$EVENT_TYPE" = "synchronize" ]; then
flyctl deploy $detach --config "$config" --app "$app" --region "$region" --image "$image" --strategy immediate --ha=$INPUT_HA --vm-cpu-kind "$INPUT_CPUKIND" --vm-cpus $INPUT_CPU --vm-memory "$INPUT_MEMORY"
exit 0
fi

# Trigger the deploy of the new version.
echo "Contents of config $config file: " && cat "$config"
if [ -n "$INPUT_VM" ]; then
Expand Down

0 comments on commit 29fa03a

Please sign in to comment.