.woodpecker.yaml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. steps:
  2. - name: Generate stats
  3. image: python
  4. environment:
  5. ACCESS_TOKEN:
  6. from_secret: ACCESS_TOKEN
  7. USER:
  8. from_secret: USER
  9. GIT_URL:
  10. from_secret: GIT_URL
  11. when:
  12. - event: manual
  13. - event: cron
  14. commands:
  15. - python -m venv venv
  16. - /bin/bash -c "source venv/bin/activate"
  17. - python -m pip install --upgrade pip
  18. - python -m pip install -r requirements.txt
  19. - python main.py
  20. - name: Commit to the repo
  21. image: alpine
  22. environment:
  23. COMMIT_TOKEN:
  24. from_secret: commit_token
  25. USER:
  26. from_secret: USER
  27. when:
  28. - event: manual
  29. - event: cron
  30. commands:
  31. - apk add git
  32. - git config --global user.name "[CI] Stats generator"
  33. - git config --global user.email $${USER}"@noreply.codeberg.org"
  34. - git remote remove origin
  35. - git remote add origin "https://"$${COMMIT_TOKEN}"@codeberg.org/"$${USER}"/forgejo-stats.git"
  36. - git add .
  37. - git commit -m "[CI] Update stats ($( env TZ=Europe/Berlin date +"%d.%m.%Y %H:%M" )) [SKIP CI]"
  38. - git push --set-upstream origin main