Skip to content

Github Action Build Caching #25971

Answered by lee-dohm
wei asked this question in Actions
Discussion options

You must be logged in to vote

GitHub Actions are extremely flexible to allow you to model whatever kind of build semantics you need. On the other hand, this means that there is a large amount of complexity to contend with. Let me start by making sure I understand what problem you’re describing.

It sounds like what you’re saying is that when you create a GitHub Action that uses a Dockerfile that is stored in a GitHub repository, when that Action is executed, the Docker container is generated each time. If I’m understanding you correctly, then it is true that the Dockerfile is evaluated each time the Action is executed but that doesn’t mean that it is built from scratch with no caching. For example, here is a sample log

Replies: 16 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet