Skip to content

Commit

Permalink
fix: fix deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
MC-XiaoHei committed Nov 27, 2024
1 parent 36ce8a1 commit bc6de12
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
TARGET_BRANCH="deploy"
BASE_BRANCH="origin/build/master"
ORIGIN_URL=$(git remote get-url origin)
SUFFIX=".git"
TARGET_URL=${ORIGIN_URL%$SUFFIX}
if git ls-remote --heads origin ${TARGET_BRANCH} | grep ${TARGET_BRANCH}; then
git push origin --delete ${TARGET_BRANCH}
Expand All @@ -32,17 +35,13 @@ jobs:
branches=$(git branch -r | grep 'origin/build/ver/')
for branch in $branches; do
branch_name=$(echo $branch | sed 's|origin/||')
local_dir=$(echo $branch_name | sed 's|build/ver/||')
git checkout -b $branch_name $branch
mkdir -p ./$local_dir
rsync -av --exclude='.git' ./ ./$local_dir
git checkout ${BASE_BRANCH}
git branch -D $branch_name
BRANCH_NAME=$(echo $branch | sed 's|origin/||')
LOCAL_DIR=$(echo $branch_name | sed 's|build/ver/||')
TARGET_ZIP="${TARGET_URL}/archive/refs/heads/${BRANCH_NAME}.zip"
mkdir -p ${LOCAL_DIR}
wget --max-redirect=10 -O ${LOCAL_DIR}/dist.zip $url
unzip ${LOCAL_DIR}/dist.zip -d ${LOCAL_DIR}
rm ${LOCAL_DIR}/dist.zip
done
git push origin "${TARGET_BRANCH}"

0 comments on commit bc6de12

Please sign in to comment.