deploy.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: Deploy
  2. on:
  3. push:
  4. branches:
  5. - dev
  6. jobs:
  7. build:
  8. if: github.repository == 'xmake-io/xmake-repo' # only runs on root repository
  9. strategy:
  10. matrix:
  11. os: [ubuntu-latest]
  12. runs-on: ${{ matrix.os }}
  13. steps:
  14. - uses: actions/checkout@v1
  15. - uses: xmake-io/github-action-setup-xmake@v1
  16. with:
  17. xmake-version: latest
  18. actions-cache-folder: '.xmake-cache'
  19. - name: Install SSH key
  20. uses: shimataro/ssh-key-action@v2
  21. with:
  22. key: ${{ secrets.SSH_KEY }}
  23. name: id_rsa # optional
  24. known_hosts: ${{ secrets.KNOWN_HOSTS }}
  25. - name: Installation
  26. run: |
  27. sudo apt update -y
  28. sudo apt install -y wget
  29. wget https://nodejs.org/dist/v14.15.4/node-v14.15.4-linux-x64.tar.xz
  30. tar -xvf node-v14.15.4-linux-x64.tar.xz
  31. export PATH=`pwd`/node-v14.15.4-linux-x64/bin:$PATH
  32. sudo npm install markdown-to-html -g
  33. git config --global user.email "[email protected]"
  34. git config --global user.name "ruki"
  35. - name: Build artifacts
  36. if: ${{ github.repository }} == "xmake-io/xmake-repo"
  37. run: |
  38. xmake l scripts/build_artifacts.lua
  39. - name: Publish documents
  40. run: |
  41. git clone [email protected]:xmake-io/xrepo-docs.git
  42. cd xrepo-docs
  43. git remote add all [email protected]:xmake-io/xrepo-docs.git
  44. git remote set-url --add all [email protected]:waruqi/xrepo-docs.git
  45. git remote set-url --add all [email protected]:xmake-io/xrepo-docs.git
  46. git remote set-url --add all [email protected]:xmake-io/xrepo-docs.git
  47. xmake l -vD `pwd`/build.lua
  48. git status
  49. git add -A
  50. git diff-index --quiet HEAD || git commit -m "autoupdate docs by xmake-repo/ci"
  51. git push all master