Skip to content

Commit bc6de12

Browse files
committed
fix: fix deploy
1 parent 36ce8a1 commit bc6de12

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

.github/workflows/deploy.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
2222
TARGET_BRANCH="deploy"
2323
BASE_BRANCH="origin/build/master"
24+
ORIGIN_URL=$(git remote get-url origin)
25+
SUFFIX=".git"
26+
TARGET_URL=${ORIGIN_URL%$SUFFIX}
2427
2528
if git ls-remote --heads origin ${TARGET_BRANCH} | grep ${TARGET_BRANCH}; then
2629
git push origin --delete ${TARGET_BRANCH}
@@ -32,17 +35,13 @@ jobs:
3235
branches=$(git branch -r | grep 'origin/build/ver/')
3336
3437
for branch in $branches; do
35-
branch_name=$(echo $branch | sed 's|origin/||')
36-
local_dir=$(echo $branch_name | sed 's|build/ver/||')
37-
38-
git checkout -b $branch_name $branch
39-
40-
mkdir -p ./$local_dir
41-
42-
rsync -av --exclude='.git' ./ ./$local_dir
43-
44-
git checkout ${BASE_BRANCH}
45-
git branch -D $branch_name
38+
BRANCH_NAME=$(echo $branch | sed 's|origin/||')
39+
LOCAL_DIR=$(echo $branch_name | sed 's|build/ver/||')
40+
TARGET_ZIP="${TARGET_URL}/archive/refs/heads/${BRANCH_NAME}.zip"
41+
mkdir -p ${LOCAL_DIR}
42+
wget --max-redirect=10 -O ${LOCAL_DIR}/dist.zip $url
43+
unzip ${LOCAL_DIR}/dist.zip -d ${LOCAL_DIR}
44+
rm ${LOCAL_DIR}/dist.zip
4645
done
4746
4847
git push origin "${TARGET_BRANCH}"

0 commit comments

Comments
 (0)