githubactions-pushed #36
  
    
      This file contains hidden or 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: mirrorgit | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: ${{ github.event.inputs.DEPLOYMENT_ENVIRONMENT }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: mirror to git | |
| run: | | |
| sudo apt update && sudo apt install git git-lfs python3-full python3-pip -y && sudo sh -c "echo StrictHostKeyChecking no >> /etc/ssh/ssh_config" | |
| sudo mkdir -p /root/.ssh | |
| sudo sh -c "echo '${{ secrets.GITEE_KEY }}' > /root/.ssh/id_rsa" | |
| #sudo sh -c "echo '${{ secrets.GITEA_KEY }}' > /root/.ssh/id_rsa" | |
| sudo chmod 600 /root/.ssh/id_rsa | |
| sudo apt remove python3-urllib3 python3-idna python3-chardet | |
| sudo pip3 install -r .github/hubmirror/requirements.txt | |
| sudo git lfs install | |
| sudo python3 .github/hubmirror/hubmirror.py --src "github/minlearn" --dst "gitee/minlearn" --dst-key "${{ secrets.GITEE_KEY }}" --dst-token "${{ secrets.GITEE_TOKEN }}" --static-list "minlearnprogramming" --account-type "org" --force-update "true" | |
| #sudo python3 .github/hubmirror/hubmirror.py --src "github/minlearn" --dst "gitea/minlearn" --gitea-url http://106.52.32.20/gitea --dst-key "${{ secrets.GITEA_KEY }}" --dst-token "${{ secrets.GITEA_TOKEN }}" --static-list "minlearnprogramming" --force-update "true" |