浏览代码

add deploy ci

ruki 4 年之前
父节点
当前提交
0561835821
共有 1 个文件被更改,包括 41 次插入0 次删除
  1. 41 0
      .github/workflows/deploy.yml

+ 41 - 0
.github/workflows/deploy.yml

@@ -0,0 +1,41 @@
+name: Deploy
+
+on:
+  push:
+    branches:
+      - master
+
+jobs:
+  build:
+    strategy:
+      matrix:
+        os: [ubuntu-latest]
+
+    runs-on: ${{ matrix.os }}
+
+    steps:
+      - name: Install Xmake
+      - uses: xmake-io/github-action-setup-xmake@v1
+        with:
+          xmake-version: branch@dev
+
+      - name: Install SSH key
+        uses: shimataro/ssh-key-action@v2
+        with:
+          key: ${{ secrets.SSH_KEY }}
+          name: id_rsa # optional
+          known_hosts: ${{ secrets.KNOWN_HOSTS }}
+
+      - name: Publish
+        run: |
+          git clone [email protected]:xmake-io/xrepo-docs.git
+          cd xrepo-docs
+          git remote add all [email protected]:xmake-io/xrepo-docs.git
+          git remote set-url --add all [email protected]:waruqi/xrepo-docs.git
+          git remote set-url --add all [email protected]:xmake-io/xrepo-docs.git
+          git remote set-url --add all [email protected]:xmake-io/xrepo-docs.git
+          xmake l build.lua
+          git commit -a -m "update docs"
+          git push all master
+
+