Skip to content

Commit

Permalink
Test build.
Browse files Browse the repository at this point in the history
  • Loading branch information
M1hono committed Oct 27, 2024
1 parent 556bba8 commit d08aacf
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,29 @@ jobs:
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Clone private repo
- name: Clone workflow file
run: |
# 改进版本
if ! grep -q github.com ~/.ssh/known_hosts; then
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-keyscan github.com >> ~/.ssh/known_hosts || exit 1
fi
mkdir -p temp_repo || exit 1
cd temp_repo || exit 1
git init || exit 1
git remote add -f origin [email protected]:M1hono/CrychicDocSynchronization.git || exit 1
git config core.sparseCheckout true || exit 1
echo ".github/workflows/deploy.yaml" >> .git/info/sparse-checkout
mkdir -p ../.vitepress/dist/.github/workflows/ || exit 1
GIT_SSH_COMMAND='ssh -i /home/mihono/.ssh/id_rsa' git pull origin main --depth 1 || exit 1
if [ -f .github/workflows/deploy.yaml ]; then
cp .github/workflows/deploy.yaml ../.vitepress/dist/.github/workflows/ || exit 1
echo "指定文件拉取并复制成功"
else
echo "错误:未找到目标文件"
exit 1
fi
mkdir temp_repo
cd temp_repo
git init
git remote add -f origin [email protected]:M1hono/CrychicDocSynchronization.git
git config core.sparseCheckout true
echo ".github/workflow/deploy.yaml" >> .git/info/sparse-checkout
GIT_SSH_COMMAND='ssh -i /home/mihono/.ssh/id_rsa' git pull origin main --depth 1
cd ..
cp temp_repo/.github/workflow/deploy.yaml .vitepress/dist/.github/workflow/
- name: Push to private repo
run: |
Expand Down

0 comments on commit d08aacf

Please sign in to comment.