I'm having a hard time passing env variables to Dockerfile when using GitHub actions

I’m trying to use GitHub actions to deploy my project but I’m having a hard time getting my secrets from GitHub into the docker container I’m using for my fly app. My project code is here with all the configs GitHub - silentworks/lnkd, can someone point me in the right direction please.

You should set runtime secrets manually with flyctl secrets set and leave the build secrets to GitHub. This way your secrets are encrypted in fly and not spread to multiple places.

I don’t think this answer is related to what I’m asking, I’m asking about build time env variables and how to pass them from the GitHub action to the fly build process. I’m using Dockerfile for my build and no matter how I pass the env variable on they don’t seem to get into the build process.

I see what you are saying, yes I misunderstood. The args property is passed through to flyctl, so you’d need to put them in the string, like

      - name: Deploy app
        uses: superfly/flyctl-actions@1.1
        with:
          args: 
            "deploy --build-arg ABC= ${{ secrets.ABC }}

I haven’t used GH actions in a while so it might have special interpolation rules you need to adjust for. I hope that helps.