Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Update Cumulative Users #41

Merged
merged 1 commit into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions .github/workflows/Update-Cumulative-Users.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
name: Update-Cumulative-Users
on:
schedule:
- cron: "55 23 * * *"
schedule:
- cron: "55 23 * * *"
workflow_dispatch:

jobs:
test:
update-data:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.9.x'

Expand All @@ -26,10 +27,19 @@ jobs:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: |
python analytics.py
- name: Save file

- name: Commit files
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add unique_visitors.csv cumulative_unique_visitors.png
git commit -m "Update unique visitors and cumulative visitors"
git push origin main
git commit -m "Update unique visitors and cumulative visitors" || echo "No changes to commit"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update data
title: "Automated data update"
body: "This is an auto-generated update of the cumulative users data."
branch: "update-cumulative-users"
delete-branch: true
base: "main"
Binary file modified cumulative_unique_visitors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions unique_visitors.csv
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ timestamp,value
15 JAN 2024,70
16 JAN 2024,45
17 JAN 2024,58
18 JAN 2024, 73
19 JAN 2024, 61
Loading