I’d not recommend it, last time I tried I used a GoPro roll bar mount, no matter how tight I did it up, it rotated, inner tubes under the clamp, bits of rubber, gaffer tape, nothing stopped it moving. To the point where it went in my wheel and got flung about 50 yards down the trail in front of me.
Maybe you could rig something up from the disc brake mounts? at least it wont be able to rotate then