From a4c44bdeaef31dac6c772d92f323a2484e6cdf51 Mon Sep 17 00:00:00 2001 From: Dan Ellis Date: Tue, 12 Dec 2023 08:51:56 +0000 Subject: [PATCH] Update deploy.yml --- .github/workflows/deploy.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 311f84f..1a36cee 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -40,16 +40,25 @@ jobs: git fetch --all + # Check if there are any local changes + if [ -n "$(git status --porcelain)" ]; then + # If there are changes, commit them + git add . + git commit -m "Committing local changes before switching branches" + else + echo "No local changes to commit." + fi + git checkout production # Remove files and directories from the production branch git rm -r --ignore-unmatch */* - git checkout main -- site + + git mv site docs git add -A git commit -m "Content update" - git mv site docs git push