-
Notifications
You must be signed in to change notification settings - Fork 13
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
Showing
1 changed file
with
20 additions
and
11 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 |
---|---|---|
|
@@ -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: | | ||
|