Skip to content

Commit

Permalink
Update cd_pipeline.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
arpita0911patel authored May 17, 2024
1 parent be7a549 commit 84110c0
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions .github/workflows/cd_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
Expand Down Expand Up @@ -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/[email protected]
Expand All @@ -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

0 comments on commit 84110c0

Please sign in to comment.