feat: update workflow
This commit is contained in:
parent
d6650f8bdd
commit
fff4c0d23d
|
@ -37,11 +37,8 @@ jobs:
|
||||||
if [ "$local_hash" != "$remote_hash" ]; then
|
if [ "$local_hash" != "$remote_hash" ]; then
|
||||||
echo "Hashes are different, updating Joint-Teapot..."
|
echo "Hashes are different, updating Joint-Teapot..."
|
||||||
pip install git+https://ghp.ci/https://github.com/BoYanZh/Joint-Teapot
|
pip install git+https://ghp.ci/https://github.com/BoYanZh/Joint-Teapot
|
||||||
|
|
||||||
echo "hashes_match=false" >> $GITHUB_ENV
|
|
||||||
else
|
else
|
||||||
echo "Hashes are the same, no update required."
|
echo "Hashes are the same, no update required."
|
||||||
echo "hashes_match=true" >> $GITHUB_ENV
|
|
||||||
fi
|
fi
|
||||||
# - name: Lint
|
# - name: Lint
|
||||||
# run: make lint
|
# run: make lint
|
||||||
|
@ -81,12 +78,31 @@ jobs:
|
||||||
git push
|
git push
|
||||||
triger-update-ci:
|
triger-update-ci:
|
||||||
container:
|
container:
|
||||||
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest
|
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ci-test
|
||||||
volumes:
|
volumes:
|
||||||
- /home/actions/.ssh:/root/.ssh
|
- /home/actions/.ssh:/root/.ssh
|
||||||
needs: build
|
needs: build
|
||||||
if: github.env.hashes_match == 'false'
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check update
|
||||||
|
run: |
|
||||||
|
if [ -f /master_hash.txt ]; then
|
||||||
|
local_hash=$(cat /master_hash.txt)
|
||||||
|
else
|
||||||
|
local_hash=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
remote_hash=$(git ls-remote https://ghp.ci/https://github.com/BoYanZh/Joint-Teapot | grep master | awk '{print $1}')
|
||||||
|
|
||||||
|
echo "Local hash: $local_hash"
|
||||||
|
echo "Remote hash: $remote_hash"
|
||||||
|
|
||||||
|
if [ "$local_hash" != "$remote_hash" ]; then
|
||||||
|
echo "Hashes are different, updating Joint-Teapot..."
|
||||||
|
pip install git+https://ghp.ci/https://github.com/BoYanZh/Joint-Teapot
|
||||||
|
else
|
||||||
|
echo "Hashes are the same, no update required."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
- name: Set up Git
|
- name: Set up Git
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "gitea-actions[bot]"
|
git config --global user.name "gitea-actions[bot]"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user