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 f927ae5 commit 5284315
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/cd_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ jobs:
- name: Clear git worktree before deployment
run: |
git worktree prune
if [ -d "github-pages-deploy-action-temp-deployment-folder" ]; then
rm -rf github-pages-deploy-action-temp-deployment-folder
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
if git worktree list | grep -q '\[main\]'; then
echo "Removing existing main worktree"
git worktree remove $(git worktree list | grep '\[main\]' | awk '{print $1}') --force
fi
- name: Download a Build Artifact Version
uses: dawidd6/[email protected]
Expand Down Expand Up @@ -67,7 +72,10 @@ jobs:
echo "Removing existing temp deployment folder"
git worktree remove github-pages-deploy-action-temp-deployment-folder --force
fi
if git worktree list | grep -q '\[main\]'; then
echo "Removing existing main worktree"
git worktree remove $(git worktree list | grep '\[main\]' | awk '{print $1}') --force
fi
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
Expand All @@ -78,3 +86,9 @@ jobs:
repository-name: CIROH-UA/ciroh-ua.github.io
#tag: $VERSION

- 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

0 comments on commit 5284315

Please sign in to comment.