Skip to content

Commit

Permalink
Merge pull request #653 from shawnthompson/main
Browse files Browse the repository at this point in the history
Integrate analytics update into main deployment GitHub Action
  • Loading branch information
shawnthompson authored Oct 25, 2024
2 parents c4685e6 + 9473161 commit 3e99f81
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 35 deletions.
27 changes: 26 additions & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,37 @@
name: github pages
name: Deploy and Update Analytics

on:
push:
branches:
- main
schedule:
- cron: '0 0 * * *' # Runs every day at midnight UTC
workflow_dispatch: # Allows manual triggering

jobs:
update-analytics:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node
uses: actions/[email protected]
with:
node-version: '20.x'

- run: npm install

- name: Run analytics update
run: npm run analytics
env:
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
GOOGLE_REFRESH_TOKEN: ${{ secrets.GOOGLE_REFRESH_TOKEN }}
PROPERTY_ID: ${{ secrets.PROPERTY_ID }}

deploy:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/update-analytics.yml

This file was deleted.

0 comments on commit 3e99f81

Please sign in to comment.