diff --git a/.github/workflows/cd_pipeline.yml b/.github/workflows/cd_pipeline.yml index 2110a19..d9ef25b 100644 --- a/.github/workflows/cd_pipeline.yml +++ b/.github/workflows/cd_pipeline.yml @@ -26,20 +26,6 @@ jobs: # Ensure detached HEAD state to avoid conflicts with the main branch ref: refs/heads/main - - name: Clear git worktree before deployment - run: | - git worktree prune - if git worktree list | grep -q 'github-pages-deploy-action-temp-deployment-folder'; then - echo "Removing existing temp deployment folder" - git worktree remove github-pages-deploy-action-temp-deployment-folder --force - fi - # Check and remove any worktree associated with the deployment if it exists - if git worktree list | grep -q 'github-pages-deploy-action'; then - echo "Removing existing deployment worktree" - DEPLOYMENT_WORKTREE=$(git worktree list | grep 'github-pages-deploy-action' | awk '{print $1}') - git worktree remove "$DEPLOYMENT_WORKTREE" --force - fi - - name: Download a Build Artifact Version uses: dawidd6/action-download-artifact@v2.26.1 with: @@ -86,7 +72,7 @@ jobs: - name: Create and switch to a temporary deployment branch run: | - git checkout -b temp-deploy-branch + git checkout -b temp-deploy-branch-$VERSION - name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4.4.0 @@ -96,16 +82,4 @@ jobs: folder: build repository-name: CIROH-UA/ciroh-ua.github.io - - name: Final cleanup - run: | - git worktree prune - if [ -d "github-pages-deploy-action-temp-deployment-folder" ]; then - rm -rf github-pages-deploy-action-temp-deployment-folder - fi - if git worktree list | grep -q 'github-pages-deploy-action'; then - echo "Removing existing deployment worktree" - DEPLOYMENT_WORKTREE=$(git worktree list | grep 'github-pages-deploy-action' | awk '{print $1}') - git worktree remove "$DEPLOYMENT_WORKTREE" --force - fi - # Clean up the temporary deployment branch - git branch -D temp-deploy-branch +