JOJ3/.gitea/workflows/submodule.yaml
张泊明518370910136 091c58e9e9
Some checks failed
submodules sync / sync (push) Successful in 29s
build / build (push) Failing after 1m12s
build / trigger-build-image (push) Has been skipped
ci(submodule): cleanup commands
2024-10-19 07:10:03 -04:00

41 lines
1.4 KiB
YAML

name: submodules sync
on:
push:
branches:
- master
jobs:
sync:
container:
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest
steps:
- name: Check out repository code
uses: https://gitea.com/BoYanZh/checkout@focs
with:
fetch-depth: 0
- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_ed25519.pub
chmod 600 ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519.pub
ssh-keyscan -p 2222 focs.ji.sjtu.edu.cn >> ~/.ssh/known_hosts
ssh -T git@focs.ji.sjtu.edu.cn -p 2222
- name: Set up Git
run: |
git config --global user.name "gitea-actions[bot]"
git config --global user.email "gitea-actions[bot]@users.noreply.gitea.com"
git remote set-url origin ssh://git@focs.ji.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"
git push