Skip to content

Commit 3d1fe31

Browse files
authored
fix: document deployment
1 parent eb34433 commit 3d1fe31

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,20 @@ export default {
9696

9797
Then you can access them via `doc.gitCreatedAt` and `doc.gitUpdatedAt`.
9898

99+
## Deployment
100+
101+
The module uses the Git history to calculate the dates. That is why the history also needs to be checked out when deploying the project to live. During local development the repository is usually deeply cloned. But CI systems like GitHub Actions often only do a shallow clone for performance reasons, which will result in wrong dates.
102+
103+
To do a deep clone in a GitHub Actions workflow, configure the checkout step the following way:
104+
105+
```yaml
106+
- uses: actions/checkout
107+
with:
108+
fetch-depth: 0
109+
```
110+
111+
Also keep in mind that when deploying to static site hosters like GitHub Pages, you also need to do a deep clone on the system where you are generating the site. So do a local regular clone when generating locally, or use the config above for GitHub actions.
112+
99113
<!-- LICENSE/ -->
100114
## Contribute
101115

0 commit comments

Comments
 (0)