This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
Export timetracking statistics #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Export timetracking statistics | |
on: | |
schedule: | |
- cron: '0 23 * * 2' | |
workflow_dispatch: | |
jobs: | |
generate: | |
runs-on: [self-hosted] | |
permissions: | |
pull-requests: write | |
contents: write | |
environment: timetracking-prod | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: peterjgrainger/action-create-branch@v2.2.0 | |
name: 'Create a new branch' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
branch: 'actions/timetracking-${{ github.run_id }}' | |
sha: '${{ github.event.pull_request.head.sha }}' | |
- name: Fetch the current timetracking data | |
run: cd docs/project/timetracking && ./get_data.sh | |
env: | |
KIMAI_API_TOKEN: ${{ secrets.KIMAI_API_TOKEN }} | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pandas numpy matplotlib | |
- name: Generate the desired charts | |
run: cd docs/project/timetracking && python generate_charts.py | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actions | |
- name: 'Checkout the new branch' | |
uses: actions/checkout@v4 | |
with: | |
ref: 'actions/new-timetracking-data' | |
- name: 'Create a new Pull Request' | |
run: gh pr create -a benedictweis -B main --title \"Update timetracking data\"" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ISSUE: ${{ github.event.issue.html_url }} |