-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be7a549
commit 84110c0
Showing
1 changed file
with
2 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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] | ||
|
@@ -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 | ||
|