deploy.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Simple workflow for deploying static content to GitHub Pages
  2. name: Deploy static content to Pages
  3. on:
  4. # Runs on pushes targeting the default branch
  5. push:
  6. branches: ["main"]
  7. # Allows you to run this workflow manually from the Actions tab
  8. workflow_dispatch:
  9. # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
  10. permissions:
  11. contents: read
  12. pages: write
  13. id-token: write
  14. # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
  15. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
  16. concurrency:
  17. group: "pages"
  18. cancel-in-progress: false
  19. jobs:
  20. # Single deploy job since we're just deploying
  21. deploy:
  22. environment:
  23. name: github-pages
  24. url: ${{ steps.deployment.outputs.page_url }}
  25. runs-on: ubuntu-latest
  26. steps:
  27. - name: Checkout
  28. uses: actions/checkout@v4
  29. - name: Setup Pages
  30. uses: actions/configure-pages@v5
  31. - uses: actions/checkout@v1
  32. - uses: xmake-io/github-action-setup-xmake@v1
  33. with:
  34. xmake-version: branch@dev
  35. - name: Install SSH key
  36. uses: shimataro/ssh-key-action@v2
  37. with:
  38. key: ${{ secrets.SSH_KEY }}
  39. name: id_rsa # optional
  40. known_hosts: ${{ secrets.KNOWN_HOSTS }}
  41. - name: Build pages
  42. run: |
  43. xmake gendoc -y -s https://xmake-io.github.io/xmake-gendoc/
  44. - name: Upload artifact
  45. uses: actions/upload-pages-artifact@v3
  46. with:
  47. path: './html'
  48. - name: Deploy to GitHub Pages
  49. id: deployment
  50. uses: actions/deploy-pages@v4
  51. - name: Deploy to Vercel Pages
  52. run: |
  53. git checkout main
  54. xmake gendoc -y -s https://docs.xmake.io/ -o site
  55. git config --global user.email "[email protected]"
  56. git config --global user.name "ruki"
  57. git add -A
  58. git commit -m "autoupdate docs by xmake-gendoc/ci"
  59. git push [email protected]:waruqi/xmake-gendoc.git main -f