-
Notifications
You must be signed in to change notification settings - Fork 3
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
cd89bb1
commit 3c54c2b
Showing
1 changed file
with
92 additions
and
0 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 |
---|---|---|
|
@@ -286,3 +286,95 @@ jobs: | |
git pull --progress -v --no-rebase framagit ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支; | ||
git push -u framagit ${{ github.ref_name }} --tags --verbose | ||
fi | ||
|
||
sync-codeup-admin: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # 为了 git pull --unshallow,我们需要获取所有的提交历史 | ||
|
||
- name: Set up Git user | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "AlianBlank" | ||
- name: Set SSH | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "${{ secrets.CODEUP_ID_RSA }}" >> ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
eval $(ssh-agent -s) && ssh-add ~/.ssh/id_rsa | ||
# 信任域名 | ||
ssh-keyscan -H codeup.aliyun.com >> ~/.ssh/known_hosts | ||
# 查看当前分支 | ||
- name: Check current branch | ||
run: echo 当前分支:${{ github.ref_name }} ${{ github.Repository }} | ||
# 查看远端 地址 | ||
- name: echo git url | ||
run: echo codeup.aliyun.com:652bee7ea3bbd14127c037dd/GameFrameX/Admin/${{ github.Repository }}.git | ||
|
||
# 添加远端 | ||
- name: add remote url | ||
run: git remote add codeup "[email protected]:652bee7ea3bbd14127c037dd/GameFrameX/Admin/${{ github.Repository }}.git" | ||
|
||
# 获取 | ||
- name: fetch | ||
run: git fetch --prune codeup --tags --verbose | ||
|
||
# 拉取 | ||
- name: pull and push | ||
run: | | ||
if [ "${{ github.ref_name }}" ]; then | ||
git checkout ${{ github.ref_name }} | ||
git pull --progress -v --no-rebase codeup ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支; | ||
git push -u codeup ${{ github.ref_name }} --tags --verbose | ||
fi | ||
sync-codeup-hope: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # 为了 git pull --unshallow,我们需要获取所有的提交历史 | ||
|
||
- name: Set up Git user | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "AlianBlank" | ||
- name: Set SSH | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "${{ secrets.CODEUP_ID_RSA }}" >> ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
eval $(ssh-agent -s) && ssh-add ~/.ssh/id_rsa | ||
# 信任域名 | ||
ssh-keyscan -H codeup.aliyun.com >> ~/.ssh/known_hosts | ||
# 查看当前分支 | ||
- name: Check current branch | ||
run: echo 当前分支:${{ github.ref_name }} ${{ github.Repository }} | ||
# 查看远端 地址 | ||
- name: echo git url | ||
run: echo [email protected]:652bee7ea3bbd14127c037dd/GameFrameX/Admin.Hope/${{ github.Repository }}.git | ||
|
||
# 添加远端 | ||
- name: add remote url | ||
run: git remote add codeup "[email protected]:652bee7ea3bbd14127c037dd/GameFrameX/Admin.Hope/${{ github.Repository }}.git" | ||
|
||
# 获取 | ||
- name: fetch | ||
run: git fetch --prune codeup --tags --verbose | ||
|
||
# 拉取 | ||
- name: pull and push | ||
run: | | ||
if [ "${{ github.ref_name }}" ]; then | ||
git checkout ${{ github.ref_name }} | ||
git pull --progress -v --no-rebase codeup ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支; | ||
git push -u codeup ${{ github.ref_name }} --tags --verbose | ||
fi |