From 532134f7fd458bcde689e4f5027fde5f4c7d21c7 Mon Sep 17 00:00:00 2001 From: Diego Date: Fri, 14 Jun 2024 12:08:03 +0200 Subject: [PATCH] Ensure the latest changes are fetched and reset to the remote branch --- .github/workflows/doc.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index e16d78822f..2523b37805 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -93,20 +93,21 @@ jobs: run: | cd subdoc + # Ensure the latest changes are fetched and reset to the remote branch + git fetch origin gh-pages + git reset --hard origin/gh-pages + rm -rf docs mv ../site docs - + git add . - + if git diff-index --quiet HEAD --; then echo "No changes to commit" else git config --global user.email "${{ github.actor }}@users.noreply.github.com" git config --global user.name "${{ github.actor }}" - - # Pull the latest changes to avoid conflicts - git pull origin gh-pages --rebase - + git commit -m "update website" git push origin gh-pages fi