.woodpecker.yml 2.2 KB

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