Skip to content

Commit 795d725

Browse files
Fix Git checkout command to properly handle gh-pages branch during deployment
1 parent dd8afb4 commit 795d725

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/deploy_mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ jobs:
4646
4747
- name: Deploy documentation
4848
run: |
49-
git checkout --track origin/gh-pages
49+
git fetch origin gh-pages:gh-pages || git checkout --orphan gh-pages
50+
git checkout gh-pages
5051
# Remove all content except .git, site and vx.x.x directory
5152
find . -mindepth 1 -maxdepth 1 ! -name '.git' ! -name 'v*.*.*' ! -name 'site' -exec rm -rf {} +
5253
# Copy MkDocs output

0 commit comments

Comments
 (0)