eas build not loading the environment variables exported in terminal

Hi Everyone,
I am using direnv to set the environment variables based on the APP_ENV(local, staging, production). When i run expo run:ios or expo run:android the variables are been fetched from process.env.API_URL. But when i do an eas build --profile staging --platform android/ios its not adding the environment variable to the build, because of which its causing the application fail to call the apis. Could someone please help me on this