diff --git a/.github/workflows/contrib.yml b/.github/workflows/contrib.yml index aabfd86ff..de8b88055 100644 --- a/.github/workflows/contrib.yml +++ b/.github/workflows/contrib.yml @@ -25,14 +25,12 @@ jobs: run: | cd src/doc/contrib mdbook build - git worktree add gh-pages gh-pages + # Override previous ref to avoid keeping history. + git worktree add --orphan -B gh-pages gh-pages git config user.name "Deploy from CI" git config user.email "" cd gh-pages - # Delete the ref to avoid keeping history. - git update-ref -d refs/heads/gh-pages - rm -rf contrib mv ../book contrib git add contrib git commit -m "Deploy $GITHUB_SHA to gh-pages" - git push --force + git push origin +gh-pages