8000 chore: deploy AIO Postgres image to Fly.io's registry (#835) · attentive-test/postgres@47b2843 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47b2843

Browse files
authored
chore: deploy AIO Postgres image to Fly.io's registry (supabase#835)
* chore: deploy AIO image to Fly's registry
1 parent 533f49a commit 47b2843

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

.github/workflows/dockerhub-release-aio.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
name: Release AIO image on Dockerhub
1+
name: Release AIO image
22

33
on:
44
push:
55
branches:
6-
- pcnc/trigger-build
6+
- develop
77
paths:
88
- ".github/workflows/dockerhub-release-aio.yml"
99
- "docker/all-in-one/*"
10-
- "common.vars*"
1110
workflow_run:
1211
workflows: [Release on Dockerhub]
1312
branches:
@@ -21,6 +20,7 @@ jobs:
2120
outputs:
2221
docker_version: ${{ steps.settings.outputs.postgres-version }}
2322
image_tag: supabase/postgres:aio-${{ steps.settings.outputs.postgres-version }}
23+
fly_image_tag: supabase-postgres-image:aio-${{ steps.settings.outputs.postgres-version }}
2424
build_args: ${{ steps.args.outputs.result }}
2525
steps:
2626
- uses: actions/checkout@v3
@@ -108,3 +108,37 @@ jobs:
108108
with:
109109
version: aio-${{ needs.settings.outputs.docker_version }}
110110
secrets: inherit
111+
112+
publish_to_fly:
113+
needs: [settings, build_image]
114+
runs-on: ubuntu-latest
115+
steps:
116+
- uses: docker/setup-buildx-action@v3
117+
- uses: docker/login-action@v2
118+
with:
119+
username: ${{ secrets.DOCKER_USERNAME }}
120+
password: ${{ secrets.DOCKER_PASSWORD }}
121+
- name: Push to Fly
122+
uses: superfly/flyctl-actions/setup-flyctl@dfdfedc86b296f5e5384f755a18bf400409a15d0
123+
with:
124+
version: 0.1.64
125+
- run: |
126+
docker pull ${{ needs.settings.outputs.image_tag }}_amd64
127+
docker tag ${{ needs.settings.outputs.image_tag }}_amd64 "registry.fly.io/staging-${{ needs.settings.outputs.fly_image_tag }}"
128+
docker tag ${{ needs.settings.outputs.image_tag }}_amd64 "registry.fly.io/prod-${{ needs.settings.outputs.fly_image_tag }}"
129+
130+
flyctl auth docker
131+
docker push "registry.fly.io/staging-${{ needs.settings.outputs.fly_image_tag }}"
132+
docker push "registry.fly.io/prod-${{ needs.settings.outputs.fly_image_tag }}"
133+
env:
134+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
135+
136+
- name: Slack Notification
137+
if: ${{ failure() }}
138+
uses: rtCamp/action-slack-notify@v2
139+
env:
140+
SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }}
141+
SLACK_USERNAME: "gha-failures-notifier"
142+
SLACK_COLOR: "danger"
143+
SLACK_MESSAGE: "Failed pushing AIO image to Fly.io"
144+
SLACK_FOOTER: ""

0 commit comments

Comments
 (0)
0