Here are a few things a quick search yielded…
Uses BGE…
Uses scripting…
import bpy
scn = bpy.data.scenes["Scene"]
com = bpy.ops.scene
path = "d:/blender/output/frame_"
i = 0
for i in range (0,30):
scn.frame_current = i
com.light_cache_bake()
scn.render.filepath = path + str(scn.frame_current)
bpy.ops.render.render(write_still=True)