mirror of
https://github.com/werf/actions.git
synced 2026-02-05 10:56:23 +03:00
Merge pull request #57 from werf/upd-readme
[1.1] docs: add notice about fetch-depth into README
This commit is contained in:
17
README.md
17
README.md
@@ -256,6 +256,23 @@ werf:
|
|||||||
WERF_ENV: production
|
WERF_ENV: production
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# FAQ
|
||||||
|
|
||||||
|
## werf always rebuilds images on new commit
|
||||||
|
|
||||||
|
Make sure to use `fetch-depth: 0` setting in the checkout action, like follows:
|
||||||
|
|
||||||
|
```
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
```
|
||||||
|
|
||||||
|
By default fetch-depth set to `1` which disables git history when checking out code. werf cache selection algorithm uses git history to determine whether some image bound to some commit could be used as a cache when building current commit (current commit should be descendant to the cache commit).
|
||||||
|
|
||||||
|
Setting `fetch-depth` to `0` enables full fetch of git history and it is a **recommended** approach. It is also possible to limit fetch history with some decent number of commits, which would enable images caching limited to that number of commits, but this would have a negative impact on cache reproducibility.
|
||||||
|
|
||||||
# License
|
# License
|
||||||
|
|
||||||
Apache License 2.0, see [LICENSE](LICENSE)
|
Apache License 2.0, see [LICENSE](LICENSE)
|
||||||
|
|||||||
Reference in New Issue
Block a user