Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
32 lines (28 sloc)
907 Bytes
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
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" | |