.woodpecker.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Sphinx build
  2. steps:
  3. - name: build-html
  4. image: sphinxdoc/sphinx
  5. when:
  6. event: [ push, pull_request, tag ]
  7. commands:
  8. #- pip3 install --upgrade pip
  9. - pip3 install --upgrade pydata-sphinx-theme
  10. - pip3 install --upgrade sphinx-copybutton
  11. - pip3 install --upgrade sphinx-design
  12. - cd ./docs
  13. - sphinx-build -b html . build -W
  14. - name: build-pdf
  15. image: sphinxdoc/sphinx-latexpdf
  16. when:
  17. event: [ push, pull_request, tag ]
  18. commands:
  19. - cd ./docs
  20. #- pip3 install --upgrade pip
  21. - pip3 install --upgrade sphinx-copybutton
  22. - pip3 install --upgrade sphinx-design
  23. - sphinx-build -M latexpdf . build -W
  24. # Based on: https://codeberg.org/gitnex/tea4j-autodeploy/src/branch/main/.woodpecker.yml
  25. - name: deploy
  26. image: alpine/git
  27. when:
  28. event: [ push, tag ]
  29. branch: main
  30. environment:
  31. # Information that should be used when authoring a commit
  32. - GIT_AUTHOR_NAME=arubot
  33. - GIT_AUTHOR_EMAIL=arubot@noreply.codeberg.org
  34. - GIT_COMMIT_MESSAGE=Synchronization with changes to the ARU
  35. # Basic information concerning the repo that
  36. - GITEA_HOST=codeberg.org
  37. - GITEA_REPOSITORY=ventureo/pages
  38. - GITEA_BRANCH=main
  39. # Username and token that should be used to authenticate against the gitea instance
  40. # - GITEA_USERNAME=secret
  41. # - GITEA_TOKEN=secret
  42. secrets: [ gitea_username, gitea_token ]
  43. commands:
  44. # Setup git credentials and checkout target branch
  45. - git clone https://codeberg.org/ventureo/pages
  46. - cp -r ./docs/build/* pages/
  47. - cd pages
  48. - git config user.name "$${GIT_AUTHOR_NAME}"
  49. - git config user.email "$${GIT_AUTHOR_EMAIL}"
  50. - git checkout "$${GITEA_BRANCH}"
  51. # Stage all important files for commit
  52. - git add -A
  53. # If files have changed, create a new commit and push it to the branch this pipeline was started on
  54. - >
  55. if git commit --message "$${GIT_COMMIT_MESSAGE}"; then
  56. git remote set-url origin "https://$${GITEA_USERNAME}:$${GITEA_TOKEN}@$${GITEA_HOST}/$${GITEA_REPOSITORY}"
  57. git push origin "$${GITEA_BRANCH}" -f
  58. fi