Warning This tutorial does contain content related to not the GitHub itself.
All tutorials: https://github.com/andry81/index#tutorials
-
Implementation can accumulate external inpage downloads counter, phpbb forum board view/replies counters, external content (svg files, images, etc) into a cache repository.
-
The workflow does use a bash script to accumulate statistic for:
-
External web page with downloads counter: accum-downloads.sh
-
PhpBB forum board views/replies counter: accum-stats.sh
-
External content cache files: accum-content.sh
-
-
Basically most of the scripts does accumulate the response. For example, the board viewes/replies accumulator script does accumulate statistic both into a single file:
traffic/board/myboard/latest.json
, and into a set of files grouped by year and allocated per day:traffic/board/myboard/by_year/YYYY/YYYY-MM-DD.json
. -
You can directly point the statistic or the content cache as a standalone commits list:
https://github.com/{{REPO_OWNER}}/{{REPO}}--gh-stats/commits/master/traffic/clones
orhttps://github.com/{{REPO_OWNER}}/{{REPO}}--gh-content-cache/commits/master
. -
All scripts does use GitHub composite action to reuse workflow code base: https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
Warning Not all features of a generic GitHub action is supported: Known Issues
You need setup 2-5 repositories.
-
Repository, where content config file will be stored:
myrepo--gh-content-config
.Note This repository is only required for the content accumulation script. This repository and a content store repository can be a single.
-
Repository, where to store downloaded content:
myrepo--gh-content-cache
.Note This repository is only required for the content accumulation script. This repository and a content config repository can be a single.
Features of a standalone content cache repository:
https://github.com/andry81-devops/gh-action--accum-content#features-of-a-standalone-content-cache-repository -
Repository, where statistic will be saved:
myrepo--gh-stats
.Note This repository is only required for the statistic accumulation script.
-
Repository, where to store github workflow support scripts:
gh-workflow
.
You can fork or use it from here: https://github.com/andry81-devops/gh-workflow -
Repository, where to store github composite action:
-
GitHub composite action to request and accumulate downloads counter statistic from a value on a web page:
https://github.com/andry81-devops/gh-action--accum-inpage-downloads -
GitHub composite action to request and accumulate a forum board post replies/views counter statistic:
https://github.com/andry81-devops/gh-action--accum-board-stats -
GitHub composite action to periodically download and accumulate content into a repository:
https://github.com/andry81-devops/gh-action--accum-content
All action scripts:
https://github.com/andry81/index#action-scripts -
Note You need to attach a personal access token (PAT) into a repository used to run a GitHub action script (
.github/workflows/*.yml
) to read content from another repository and obtain the read permission from that repository:repo
->public_repo
.
Note You need to attach a personal access token (PAT) into a repository used to run a GitHub action script (
.github/workflows/*.yml
) to write content into another repository and obtain the push permission into that repository:repo
.
Note A separate personal access token (PAT) does not require to be attached into a repository used to run a GitHub action script for another repository as long as that another repository is owned by the same owner as a repository which runs a GitHub action script.
myrepo--gh-content-config
-> needs read access permission to read repository filesmyrepo--gh-stats
-> needs read/write access permissions to read/write repository filesmyrepo--gh-content-cache
-> needs read/write content permission to read/write repository files
To generate PAT: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token
To attach PAT: https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository
The myrepo-*
repository should contain 1 file per statistic entity:
Warning You must replace all placeholder into respective values:
{{REPO_OWNER}}
-> repository owner{{REPO}}
->myrepo-*
After the github workflow yaml file is commited and pushed, you can run the action from the Actions
tab in the myrepo-*
repository.
Note See REUSE section for details if you have multiple repositories and want to store all GitHub workflow scripts (
.github/workflows/*.yml
) in a single repository.
https://github.com/andry81-devops/gh-known-issues#known-issues
https://github.com/andry81-devops/gh-known-issues#last-known-issues-updates