When does Github Action container images being built?

I use Github actions to run CI for my PHP project, works great! (PHP 7.1, 7.2, 7.3, 7.4 and now 8).

But now, I need to also run it once on a 32 (i386) architecture. So I reckon I could use a Docker image i386/php, build my Dockerfile, and using composer image and i386/php image run my tests.

However, I have a question: when is the image being built? Only once and then cached, until the action/Dockerfile changes? Or is it being build on each workflow run (which now happens on every push to develop/master).

If it’s being built just once, does that mean that if I install my depenedencies in the image, and then I update them in my sourcecode, they won’t get updated in the CI, because the image still has them old?

And if they’re being built on each run, does that mean that I have no way to cache the dependencies, and they will be installed on each push, both taking time and using Github resources unnecessarily? Previous, I could use actions/cache to cache the composer .cache/ directory. Now I don’t think I have this option.

Maybe I’ve done something terribly wrong with this Dockerfile idea. What I really want to do, is just run tests on Github Actions on any PHP version on 32-bit.