How to push to Fly Registry via GitHub Action?

Hello all,

I’m currently reworking a GitHub Action that deploys an app on Fly.io. I’m now looking to push to the Fly Registry instead, then notifying another app that the image was pushed.

I’m unsure whether the superfly/flyctl-actions/setup-flyctl Action contains the docker command. If not, I imagine that I’d need to pass the Docker configuration from fly auth to the next build step.

Is this currently possible?

Here’s where I’m at so far:

name: Push Image
on:
  push:
    branches:
      - master
env:
  FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
  checks:
    uses: ./.github/workflows/checks.yml
  deploy:
    name: Push
    needs: checks
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - run: export BUILD_NUMBER=$(git rev-list --count HEAD)
      - uses: superfly/flyctl-actions/setup-flyctl@master
      - name: Configure Docker via Fly
        run: flyctl auth docker
      - name: Push
        run: docker push registry.fly.io/<app name>:master-${BUILD_NUMBER}
     # Notify other app of new image here

docker should be available in Actions. Have you tried this config yet?

2 Likes

Not sure if it’s entirely what you mean, @brody-next-tms, but we push an image to the registry and then deploy it as two separate apps:

3 Likes

Yes; see:

and:

1 Like

My apologies is not accepting a solution and/or responding for some time now; I ran into another roadblock that prevented me from testing this.

Just wanted to let everyone know I haven’t gone away. I really do appreciate the responses! I hope to be able to get this going soon.

Oh I see, that’s right. And no I hadn’t tried the configuration yet. :see_no_evil:

I’ve got this working; thanks!

1 Like

From How To to Questions / Help

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.