gh-pages.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. name: gh-pages
  2. on:
  3. push:
  4. pull_request:
  5. jobs:
  6. skip:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - run: echo "Skip job"
  10. before:
  11. runs-on: ubuntu-latest
  12. if: "! contains(github.event.head_commit.message, '[skip ci]')"
  13. steps:
  14. - run: echo "not contains '[skip ci]'"
  15. docs:
  16. runs-on: ubuntu-latest
  17. needs: before
  18. env:
  19. nim_version: '1.2.0'
  20. steps:
  21. - uses: actions/checkout@v1
  22. - name: Cache choosenim
  23. id: cache-choosenim
  24. uses: actions/cache@v1
  25. with:
  26. path: ~/.choosenim
  27. key: ${{ runner.os }}-choosenim-${{ env.nim_version }}
  28. - name: Cache nimble
  29. id: cache-nimble
  30. uses: actions/cache@v1
  31. with:
  32. path: ~/.nimble
  33. key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
  34. - uses: jiro4989/setup-nim-action@v1
  35. with:
  36. nim-version: ${{ env.nim_version }}
  37. - name: Fix apt packages
  38. run: |
  39. # see. https://github.com/actions/virtual-environments/issues/675
  40. sudo sed -i 's/azure\.//' /etc/apt/sources.list
  41. sudo apt update -yqq
  42. - name: Install freeglut
  43. run: sudo apt install -y freeglut3 freeglut3-dev
  44. - name: Install sdl2
  45. run: sudo apt install --fix-missing -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev
  46. - name: Generate API documents
  47. run: nimble doc --index:on --project --out:docs --hints:off src/nodesnim.nim
  48. - name: Deploy documents
  49. uses: peaceiris/actions-gh-pages@v3
  50. with:
  51. github_token: ${{ secrets.GITHUB_TOKEN }}
  52. publish_dir: ./docs
  53. if: github.ref == 'refs/heads/master'