Pass a GitHub secret as a docker/build-push-action build argument, then expose it in each needed Dockerfile stage.
#environment variables
1 post tagged “environment variables”. Follow along via the #environment variables RSS feed.
Docker Build Secrets in GitHub Actions