Docker buildx in github actions

Hi
Would anyone have some recommendations on how I can avoid an issue I am facing with using Github actions to build and push my RW app as a docker image?

I am getting an error regarding environmental variables in my schema.prisma file

My schema.prisma file has the following environment variable that is set in the .env file. But the .env doesnt get pushed to github for security reasons:

schema.prisma:

generator client {
  provider      = "prisma-client-js"
  binaryTargets = env("BINARY_TARGET")
}

docker actions error log:

 #60 11.97 25hError: Command failed with exit code 1: node "/home/node/app/node_modules/prisma/build/index.js" generate --schema="/home/node/app/api/db/schema.prisma"
#60 11.97 Error: Attempted to load binaryTargets value using `env(BINARY_TARGET)` but it was not present. Please ensure that BINARY_TARGET is present in your Environment Variables

My github action file has the following rule snippet:

      - name: "Build and push image tags: api_serve"
        uses: "docker/build-push-action@v5"
        with:
          context: "."
          platforms: "linux/amd64,linux/arm64"
          push: true
          target: api_serve
          build-args: BINARY_TARGET="native"
          tags: |
            "${{ github.repository }}:latest"
            "${{ github.repository }}:${{ github.ref_name }}"

Even though I set the BINARY_TARGET as a build argument it does not get picked up by the github action runner.

One obvious option is to hard code my schema.prisma file but that would impact another deployment that I have with netlify

I hope someone with a bit more github actions experience can shed some light for me?

Many thanks
Ivo

By the way, I have tried adding this to the github actions file:

      - name: Create env file
        run: |
          touch .env
          echo BINARY_TARGET="native" >> .env

and also tried this:

      - name: "Build and push image tags: api_serve"
        uses: "docker/build-push-action@v5"
        with:
          context: "."
          platforms: "linux/amd64,linux/arm64"
          push: true
          target: api_serve
          **secrets: |
            "BINARY_TARGET: "native""
          tags: |
            "${{ github.repository }}:latest"
            "${{ github.repository }}:${{ github.ref_name }}"

No joy!