Deployment in CI issue

So I created a gitlab CI configuration and deploy job within.


deploy-job: # This job runs in the deploy stage.
  image: docker:stable
    - docker:dind
    - node:16-bullseye-slim
  stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
    - apk add --update curl && rm -rf /var/cache/apk/*
    - curl -L | sh
    - echo "Deploying application..."
    - /root/.fly/bin/flyctl auth docker -t {token}
    - /root/.fly/bin/flyctl deploy . -t {token}
    - echo "Application successfully deployed."

Building process is fine. If I do deploy with --build-only everything works fine, but without this flag at the end fly throws error:

Error failed to fetch an image or build from source: error rendering push status stream: unauthorized: not allowed

Not familiar with gitlab CI, but you should ref this GitHub Actions usage with flyctl auth docker: at 61923537967f5f488ca2e9af690163194c09fd98 · kentcdodds/ · GitHub

Specifically note, username is set to x, docker image tag set to git tip, and deploys done with -i switch linking to a docker/runc image in

Assuming you have a fly.toml in project root setup with appname and other fly config as approp and have flyctl launched the app.

You can set app name at deploy time when running fly deploy -a <appname> too.