The github action build process already passes an environment variable to webpack indicating which environment it is building for, see e.g. its use here.
So likely the main change here is to derive the vpass here to the correct value based on that environment variable.