Background context: The build-linux.yml Github Actions Workflow builds a docker image containing the vkQuake AppImage build dependencies (including apt installing many things and compiling SDL) and then uses it to build a vkQuake AppImage. The docker build step usually takes 3-5 minutes, though in the last few days on my own fork I've seen it often take 8-45 minutes or even failing because of the apt install processes having temporary connection issues to the Ubuntu package repos.
The goal of this PR is to both shave off some time in the usual case, and to make it much less likely for people to experience unusually slow or failing docker builds by preventing most builds from being necessary.
This PR makes the docker image be cached into the Github Actions cache. If the docker image is found in the cache, then it's loaded from there instead of being built. (The actual vkQuake compilation is not cached and always happens.) In this commit, it took 45 seconds to load from cache. However, if the image isn't found in the cache, the build step takes a little longer as it has to save it to the cache now (the build took 5m13s in this commit, 4m19s in this PR's commit), but this should be uncommon and still lead to net time savings.
The diff is pretty straight-forward: the PR uses the official Docker build-push-action Github Action to run the docker build with GitHub Actions caching support turned on. The action is configured in a way that's equivalent to the old docker build command except with caching being supported. No manual cache invalidation needs to be done on future changes to the Dockerfile or any other configuration; docker will only use cached results if they use the same inputs as it's using now, and it's even smart enough to load cached results of any previous untouched steps of the Dockerfile if the Dockerfile is modified.
Nothing inside of the docker image is changed by this PR. The docker image produced by this PR will still be equivalent to the one produced previously. I did update the github action itself to run on Ubuntu 22.04, but the docker image itself still runs Ubuntu 18.04 and produces AppImages compatible with Ubuntu 18.04. (I did consider updating the docker image itself to run Ubuntu 22.04 just to update everything while I was looking at it, but I found that doing that made the vkQuake AppImage no longer compatible with Ubuntu 18.04, which might not be desirable and wouldn't be good to combine with this PR anyway.)
Background context: The build-linux.yml Github Actions Workflow builds a docker image containing the vkQuake AppImage build dependencies (including apt installing many things and compiling SDL) and then uses it to build a vkQuake AppImage. The docker build step usually takes 3-5 minutes, though in the last few days on my own fork I've seen it often take 8-45 minutes or even failing because of the apt install processes having temporary connection issues to the Ubuntu package repos.
The goal of this PR is to both shave off some time in the usual case, and to make it much less likely for people to experience unusually slow or failing docker builds by preventing most builds from being necessary.
This PR makes the docker image be cached into the Github Actions cache. If the docker image is found in the cache, then it's loaded from there instead of being built. (The actual vkQuake compilation is not cached and always happens.) In this commit, it took 45 seconds to load from cache. However, if the image isn't found in the cache, the build step takes a little longer as it has to save it to the cache now (the build took 5m13s in this commit, 4m19s in this PR's commit), but this should be uncommon and still lead to net time savings.
The diff is pretty straight-forward: the PR uses the official Docker build-push-action Github Action to run the docker build with GitHub Actions caching support turned on. The action is configured in a way that's equivalent to the old
docker build
command except with caching being supported. No manual cache invalidation needs to be done on future changes to the Dockerfile or any other configuration; docker will only use cached results if they use the same inputs as it's using now, and it's even smart enough to load cached results of any previous untouched steps of the Dockerfile if the Dockerfile is modified.Nothing inside of the docker image is changed by this PR. The docker image produced by this PR will still be equivalent to the one produced previously. I did update the github action itself to run on Ubuntu 22.04, but the docker image itself still runs Ubuntu 18.04 and produces AppImages compatible with Ubuntu 18.04. (I did consider updating the docker image itself to run Ubuntu 22.04 just to update everything while I was looking at it, but I found that doing that made the vkQuake AppImage no longer compatible with Ubuntu 18.04, which might not be desirable and wouldn't be good to combine with this PR anyway.)