So I created a gitlab CI configuration and deploy job within.
gitlab-ci.yml
deploy-job: # This job runs in the deploy stage.
image: docker:stable
services:
- docker:dind
- node:16-bullseye-slim
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
variables:
FLY_API_TOKEN: $FLY_API_TOKEN
before_script:
- apk add --update curl && rm -rf /var/cache/apk/*
- curl -L https://fly.io/install.sh | sh
script:
- 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