Skip to content

Commit 87a6393

Browse files
jayqijimporter
authored andcommitted
Update CI instructions with git fetch and git config
1 parent 20651fe commit 87a6393

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

README.md

+15-11
Original file line numberDiff line numberDiff line change
@@ -227,27 +227,30 @@ state, pass `--rebase`.
227227
Some special files that you'd like to deploy along with your documentation (such
228228
as `CNAME`) aren't related to a particular version of the docs, and instead need
229229
to go in the root directory of your site. There's no special handling for this
230-
in mike, but since your built docs live on a git branch, it's still easy to
230+
in mike, but since your built docs live on a Git branch, it's still easy to
231231
manage: check out your `gh-pages` branch (or wherever your built docs
232232
live), and commit the necessary files to the root directory.
233233

234234
## Deploying via CI
235235

236-
Since mike just generates commits to an ordinary git branch, it should work
236+
Since mike just generates commits to an ordinary Git branch, it should work
237237
smoothly with your favorite CI system. However, you should keep in mind that
238238
some CI systems make shallow clones of your repository, meaning that the CI job
239239
won't have a local instance of your documentation branch to commit to. This will
240240
naturally cause issues when trying to push the commit. This is easy to resolve
241-
though. For Github Actions, you can simply disable shallow clones:
241+
though; just manually fetch your `gh-pages` branch (or whichever you deploy to)
242+
before running mike:
242243

243-
```yaml
244-
jobs:
245-
deploy-docs:
246-
steps:
247-
- uses: actions/checkout@v2
248-
with:
249-
fetch-depth: 0 # fetch all commits/branches
250-
# ...
244+
```sh
245+
git fetch origin gh-pages --depth=1
246+
```
247+
248+
You may also need to [configure a Git user][gh-action-commit] so that mike can
249+
make commits:
250+
251+
```sh
252+
git config user.name ci-bot
253+
git config user.email [email protected]
251254
```
252255

253256
## For Theme Authors
@@ -288,3 +291,4 @@ This project is licensed under the [BSD 3-clause license](LICENSE).
288291
[shtab]: https://github.com/iterative/shtab
289292
[shtab-setup]: https://github.com/iterative/shtab#cli-usage
290293
[jinja]: https://jinja.palletsprojects.com/
294+
[gh-action-commit]: https://github.com/actions/checkout#push-a-commit-using-the-built-in-token

0 commit comments

Comments
 (0)