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