From 538f2b0b07af62df09b4378a0c497ac507603259 Mon Sep 17 00:00:00 2001 From: Sebastian Rogawski Date: Mon, 14 Oct 2024 23:00:00 -0700 Subject: [PATCH] add fix for missing gh-pages branch --- .github/workflows/build_docs.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 5391f27..b77415e 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -34,11 +34,16 @@ jobs: run: | git config --global user.name "GitHub Actions" git config --global user.email "actions@github.com" - git fetch --no-tags origin +refs/heads/gh-pages:refs/remotes/origin/gh-pages - git checkout gh-pages || git checkout --orphan gh-pages + + if git ls-remote --exit-code origin gh-pages; then + git fetch origin gh-pages + git checkout gh-pages + else + git checkout --orphan gh-pages + fi + rm -rf * cp -r public/* . git add . git commit -m "Deploy updated documentation to GitHub Pages from commit $GITHUB_SHA" git push origin gh-pages --force -