Hi - we sent in an email support question about this but I thought I’d post here as well. We’re trying to make our CI/CD pipeline compatible with your v2 so that we can move to a machines-based app. Currently our workflow does this:
flyctl deploy <some stuff here> --build-arg dev <some more stuff here>
Unfortunately --env will affect the runtime environment not the build environment.
Rather than reworking your pipeline to use the machines command though, you could instead continue to use deploy and use the --force-machines argument.
(--build-arg in fact can be used with machines run, it’s just hidden as it’s not something we expect people to need all that often.)