|
1 |
| -name: Release AIO image on Dockerhub |
| 1 | +name: Release AIO image |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
5 | 5 | branches:
|
6 |
| - - pcnc/trigger-build |
| 6 | + - develop |
7 | 7 | paths:
|
8 | 8 | - ".github/workflows/dockerhub-release-aio.yml"
|
9 | 9 | - "docker/all-in-one/*"
|
10 |
| - - "common.vars*" |
11 | 10 | workflow_run:
|
12 | 11 | workflows: [Release on Dockerhub]
|
13 | 12 | branches:
|
|
21 | 20 | outputs:
|
22 | 21 | docker_version: ${{ steps.settings.outputs.postgres-version }}
|
23 | 22 | image_tag: supabase/postgres:aio-${{ steps.settings.outputs.postgres-version }}
|
| 23 | + fly_image_tag: supabase-postgres-image:aio-${{ steps.settings.outputs.postgres-version }} |
24 | 24 | build_args: ${{ steps.args.outputs.result }}
|
25 | 25 | steps:
|
26 | 26 | - uses: actions/checkout@v3
|
@@ -108,3 +108,37 @@ jobs:
|
108 | 108 | with:
|
109 | 109 | version: aio-${{ needs.settings.outputs.docker_version }}
|
110 | 110 | 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