-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (28 loc) · 907 Bytes
/
gitee.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Push to gitee
on:
push:
branches:
- gitee
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set SSH Key
env:
SSH_KEY: ${{ secrets.GITEE_SSH_KEY }}
SSH_KEY_PUB: ${{ secrets.GITEE_SSH_PUB }}
run: |
mkdir -p ~/.ssh
ssh-keyscan -H gitee.com >> ~/.ssh/known_hosts
echo ${SSH_KEY} > ~/.ssh/id_rsa
sed -i -e "s#\\\\n#\n#g" ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo ${SSH_KEY_PUB} > ~/.ssh/id_rsa.pub
chmod 600 ~/.ssh/id_rsa.pub
- name: Push to gitee
run: |
git switch -c master
git remote add gitee git@gitee.com:befovy/images.git
imgbot=`git rev-parse HEAD | git show -s --format='%ae' | grep imgbot` || echo "no imgbot"
[[ ! -z "$imgbot" ]] && git push --set-upstream gitee master -f || echo "Ingore push"