Skip to content

Commit 3e99f81

Browse files
Merge pull request #653 from shawnthompson/main
Integrate analytics update into main deployment GitHub Action
2 parents c4685e6 + 9473161 commit 3e99f81

File tree

2 files changed

+26
-35
lines changed

2 files changed

+26
-35
lines changed

.github/workflows/gh-pages.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,37 @@
1-
name: github pages
1+
name: Deploy and Update Analytics
22

33
on:
44
push:
55
branches:
66
- main
7+
schedule:
8+
- cron: '0 0 * * *' # Runs every day at midnight UTC
9+
workflow_dispatch: # Allows manual triggering
710

811
jobs:
12+
update-analytics:
13+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v2.1.2
20+
with:
21+
node-version: '20.x'
22+
23+
- run: npm install
24+
25+
- name: Run analytics update
26+
run: npm run analytics
27+
env:
28+
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
29+
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
30+
GOOGLE_REFRESH_TOKEN: ${{ secrets.GOOGLE_REFRESH_TOKEN }}
31+
PROPERTY_ID: ${{ secrets.PROPERTY_ID }}
32+
933
deploy:
34+
if: github.event_name == 'push'
1035
runs-on: ubuntu-latest
1136
steps:
1237
- uses: actions/checkout@v4

.github/workflows/update-analytics.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)