deploy_docs.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. name: 📖 Deploy docs
  2. run-name: 📖 Deploy docs ${{ github.sha }}
  3. on:
  4. push:
  5. paths:
  6. - 'manual/**'
  7. branches:
  8. - master
  9. - maintenance-release
  10. - manticore-*
  11. env:
  12. DOCS_AUTOCOMMIT_TITLE: Docs_examples_update
  13. jobs:
  14. check:
  15. uses: ./.github/workflows/check_docs.yml
  16. secrets: inherit
  17. commit_info:
  18. name: Commit info
  19. runs-on: ubuntu-22.04
  20. steps:
  21. - run: |
  22. echo "# Docs deployment for commit ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
  23. echo "* Commit URL: [${{ github.sha }}](/${{ github.repository }}/commit/${{ github.sha }})" >> $GITHUB_STEP_SUMMARY
  24. echo "* Initiated by: [@${{ github.actor }}](https://github.com/${{ github.actor }})" >> $GITHUB_STEP_SUMMARY
  25. echo "* Ref: ${{ github.ref_type }} \"${{ github.ref_name }}\"" >> $GITHUB_STEP_SUMMARY
  26. echo "* Attempt: ${{ github.run_attempt }}" >> $GITHUB_STEP_SUMMARY
  27. docs_autocommit_check:
  28. name: Check for doc deployment autocommits
  29. needs: [check]
  30. runs-on: ubuntu-22.04
  31. outputs:
  32. res: ${{ steps.check.outputs.res }}
  33. steps:
  34. - id: check
  35. if: ${{ github.event.head_commit.message != env.DOCS_AUTOCOMMIT_TITLE }}
  36. run: echo "res=ok" >> $GITHUB_OUTPUT
  37. docs_deploy:
  38. name: Manticore Manual doc deployment
  39. runs-on: ubuntu-22.04
  40. needs: docs_autocommit_check
  41. if: needs.docs_autocommit_check.outputs.res == 'ok'
  42. defaults:
  43. run:
  44. shell: bash
  45. # timeout-minutes: 30
  46. container:
  47. image: manticoresearch/docs_autodeploy_multi:latest
  48. env:
  49. CACHEB: "../cache"
  50. DOCKER_HOST: tcp://docker:2375/
  51. DOCKER_DRIVER: overlay2
  52. RELEASE_FILENAME: latest_release_version
  53. COMMIT_DIR: manual
  54. DEPLOY_SOURCE: github
  55. DEPLOY_TARGET: k8s
  56. DOCS_ERRORS_DIR: build/docs/
  57. DOCS_AUTOCOMMIT_TITLE: ${{ env.DOCS_AUTOCOMMIT_TITLE }}
  58. DOCS_EXAMPLES_FILEPATH: 'build/test/examples.txt'
  59. GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
  60. CI_PROJECT_TITLE: dev
  61. CI_PROJECT_PATH: manticoresoftware/manticoresearch
  62. CI_PROJECT_DIR: /__w/manticoresearch/manticoresearch
  63. CI_COMMIT_SHA: ${{ github.sha }}
  64. CI_COMMIT_BRANCH: ${{ github.ref_name }}
  65. CI_COMMIT_TITLE: ${{ github.event.head_commit.message }}
  66. steps:
  67. - name: Install fresh git
  68. run: |
  69. echo 'APT::Key::Assert-Pubkey-Algo ">=rsa1024";' > /etc/apt/apt.conf.d/99weakkey-warning
  70. apt-get update --allow-releaseinfo-change
  71. add-apt-repository -y ppa:git-core/ppa
  72. apt-get update
  73. apt-get install -y git
  74. - name: Checkout
  75. uses: actions/[email protected]
  76. with:
  77. token: ${{ secrets.GITHUB_TOKEN }}
  78. set-safe-directory: true
  79. fetch-depth: 0
  80. - name: Initialization
  81. # without adding the safe.directory the script fails to do git show ...
  82. run: git config --global --add safe.directory /__w/manticoresearch/manticoresearch
  83. - name: Deploy
  84. run: |
  85. sh /Deploy/autoupdate.sh $DEPLOY_TARGET $COMMIT_DIR $DOCS_ERRORS_DIR
  86. - name: Upload artifact
  87. if: always()
  88. uses: manticoresoftware/upload_artifact_with_retries@v4
  89. with:
  90. name: Docs deploy error artifact
  91. path: $DOCS_ERRORS_DIR