Explorar el Código

workflow: add sync with aliyun git repo

wangweimin hace 5 años
padre
commit
7b7418df2c
Se han modificado 1 ficheros con 16 adiciones y 1 borrados
  1. 16 1
      .github/workflows/test.yml

+ 16 - 1
.github/workflows/test.yml

@@ -1,4 +1,4 @@
-name: Tests
+name: Tests and Sync
 on: [push, pull_request]
 jobs:
   test:
@@ -24,3 +24,18 @@ jobs:
       - name: Upload Codecov Report
         working-directory: ./test
         run: bash <(curl -s https://codecov.io/bash)
+  sync:
+    runs-on: ubuntu-latest
+    if: github.event_name == 'push'
+    steps:
+      - name: Checkout
+        uses: actions/checkout@master
+      - name: Push
+        run: |
+          git fetch --unshallow origin
+          git remote add aliyun "https://code.aliyun.com/wang0618/pywebio.git"
+          git config credential.helper '!f() { sleep 1; echo "username=${ALIYUN_GIT_USER}"; echo "password=${ALIYUN_GIT_PASSWORD}"; }; f'
+          git push -f -u aliyun
+        env:
+          ALIYUN_GIT_USER: ${{ secrets.ALIYUN_GIT_USER }}
+          ALIYUN_GIT_PASSWORD: ${{ secrets.ALIYUN_GIT_PASSWORD }}