JOJ3/.gitea/workflows/submodule.yaml
张泊明518370910136 04e7b0a5bd
Some checks failed
build / build (push) Failing after 9s
build / trigger-build-image (push) Has been skipped
submodules sync / sync (push) Failing after 9s
chore: log CI
2026-07-22 21:10:04 -07:00

47 lines
1.5 KiB
YAML

name: submodules sync
on:
push:
branches:
- master
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@focs
with:
fetch-depth: 0
- name: Set up SSH
run: |
echo ">>> mkdir ~/.ssh"
mkdir -p ~/.ssh
echo ">>> write private key"
echo "${{ secrets.DEPLOY_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
echo ">>> write public key"
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_ed25519.pub
echo ">>> chmod private key"
chmod 600 ~/.ssh/id_ed25519
echo ">>> chmod public key"
chmod 600 ~/.ssh/id_ed25519.pub
echo ">>> ssh-keyscan"
ssh-keyscan -p 2222 focs.gc.sjtu.edu.cn >> ~/.ssh/known_hosts
echo ">>> ssh test"
ssh -T git@focs.gc.sjtu.edu.cn -p 2222
- name: Set up Git
run: |
git config --global user.name "bot-joj"
git config --global user.email "bot-joj@focs.gc.sjtu.edu.cn"
git remote set-url origin ssh://git@focs.gc.sjtu.edu.cn:2222/JOJ/JOJ3.git
- name: Git Submodule Update
run: |
git submodule init
git submodule update --init --recursive
git pull --recurse-submodules
git submodule update --remote --recursive
- name: Commit update
shell: bash
run: |
git add .
git diff-index --quiet HEAD || git commit -m "chore: update submodule references [skip ci]"
git push