Skip to content

Commit

Permalink
Merge pull request #67 from brown9804/visitors-count
Browse files Browse the repository at this point in the history
Visitors count
  • Loading branch information
brown9804 authored Jan 16, 2025
2 parents bc7019d + 33675c9 commit afe60dd
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: Track Visitors and Generate Summaries

on:
push:
branches:
- main # Trigger the workflow on push to the main branch
schedule:
- cron: '*/10 * * * *' # Runs every 10 minutes
workflow_dispatch: # Allows manual triggering
workflow_dispatch:

jobs:
track-and-summarize:
Expand Down Expand Up @@ -63,5 +58,4 @@ jobs:
git commit -m 'Update visitor logs and summaries'
git pull origin visitors-count --rebase # Ensure the branch is up to date
git push origin visitors-count
fi
fi
38 changes: 38 additions & 0 deletions .github/workflows/caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Trigger Track Visitors and Generate Summaries

on:
schedule:
- cron: '*/10 * * * *' # Runs every 10 minutes
workflow_dispatch:
inputs:
runs:
description: 'Runs'
type: number
default: 1
required: false

jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up GitHub CLI
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt update
sudo apt install gh
- name: Authenticate GitHub CLI
run: gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"

- name: Trigger Callee Workflow
env:
RUNS: ${{ inputs.runs }}
run: |
for (( i=0; i<RUNS; i++ )); do
gh workflow run --repo "$GITHUB_REPOSITORY" Track Visitors and Generate Summaries
sleep 600 # Sleep for 10 minutes
done

0 comments on commit afe60dd

Please sign in to comment.