123456789101112131415161718192021222324252627282930313233343536373839 |
- steps:
- - name: Generate stats
- image: python
- environment:
- ACCESS_TOKEN:
- from_secret: ACCESS_TOKEN
- USER:
- from_secret: USER
- GIT_URL:
- from_secret: GIT_URL
- when:
- - event: manual
- - event: cron
- commands:
- - python -m venv venv
- - /bin/bash -c "source venv/bin/activate"
- - python -m pip install --upgrade pip
- - python -m pip install -r requirements.txt
- - python main.py
- - name: Commit to the repo
- image: alpine
- environment:
- COMMIT_TOKEN:
- from_secret: commit_token
- USER:
- from_secret: USER
- when:
- - event: manual
- - event: cron
- commands:
- - apk add git
- - git config --global user.name "[CI] Stats generator"
- - git config --global user.email $${USER}"@noreply.codeberg.org"
- - git remote remove origin
- - git remote add origin "https://"$${COMMIT_TOKEN}"@codeberg.org/"$${USER}"/forgejo-stats.git"
- - git add .
- - git commit -m "[CI] Update stats ($( env TZ=Europe/Berlin date +"%d.%m.%Y %H:%M" )) [SKIP CI]"
- - git push --set-upstream origin main
|