Docker container should be tagged by branch name
The container built by the job build_ci
is always tagged latest
: while this has been the habit until now for caching the environment in pipelines on shared runners, I noticed very recently that this can lead to bad scenarios if the development spans on several branches with incompatible environments (which can occur as soon as some branches introduce a breaking change during an update for instance). Indeed, the Dockerfile is only rebuilt if it changes in the commits which fire the pipeline, that is to say if the file changed relatively to its last state in the same branch: if the Dockerfile
has been rebuilt from another branch B
with an incompatible environment between two commits in a branch A
that do not change the environment, then the pipeline for the last commit in A
fails.
I have documented a solution here and you can look at latex-beamer or act for examples.