deploy.yml 1.7 KB

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