From 13312abd52422a6773f391d5a943c068a4183fed Mon Sep 17 00:00:00 2001 From: Martin Robledo Date: Thu, 12 Oct 2023 11:42:47 -0600 Subject: [PATCH] feat: cron job for github activity script --- .github/workflows/deploy.yml | 4 ++++ githubActivity.sh | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 githubActivity.sh diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1308cf9b..6c1b6b97 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -243,6 +243,10 @@ jobs: chmod +x /home/admin/projectlab/app/profilesmigration.sh echo "0 13 * * * /home/admin/projectlab/app/profilesmigration.sh" | crontab - + echo "*** Cron job to get github activity ****" + chmod +x /home/admin/projectlab/app/githubActivity.sh + echo "0 0 * * * /home/admin/projectlab/app/githubActivity.sh" | crontab - + echo "*** Step: *** Start pm2 service" pm2 start ecosystem.config.js pm2 save diff --git a/githubActivity.sh b/githubActivity.sh new file mode 100644 index 00000000..b20dd31f --- /dev/null +++ b/githubActivity.sh @@ -0,0 +1,4 @@ +mkdir -p /home/admin/logs/githubjobs +LOGFILE="/home/admin/logs/githubjobs/projectsActivity-"$(date "+%Y%m%d%H%M%S")".log" +cd /home/admin/projectlab/app +npx ts-node --project ./ts-node.tsconfig.json ./tasks/GitHubDataManage/getGitHubActivityByProject.ts >> $LOGFILE \ No newline at end of file