deploy.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. name: Deploy
  2. on:
  3. push:
  4. branches:
  5. - dev
  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. git config --global user.email "[email protected]"
  33. git config --global user.name "ruki"
  34. - name: Build artifacts
  35. if: ${{ github.repository }} == "xmake-io/xmake-repo"
  36. run: |
  37. xmake l scripts/build_artifacts.lua
  38. - name: Publish documents
  39. run: |
  40. git clone [email protected]:xmake-io/xrepo-docs.git
  41. cd xrepo-docs
  42. git remote add all [email protected]:xmake-io/xrepo-docs.git
  43. git remote set-url --add all [email protected]:waruqi/xrepo-docs.git
  44. git remote set-url --add all [email protected]:xmake-io/xrepo-docs.git
  45. git remote set-url --add all [email protected]:xmake-io/xrepo-docs.git
  46. xmake l -vD `pwd`/build.lua
  47. git status
  48. git add -A
  49. git diff-index --quiet HEAD || git commit -m "autoupdate docs by xmake-repo/ci"
  50. git push all master