Skip to content

GTrends

GTrends #14

Workflow file for this run

name: "GTrends"
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 5 1 * *' # runs monthly on the first at 05:00
jobs:
gtrends-metrics:
runs-on: ubuntu-latest
steps:
- name: Checking out main branch
uses: actions/checkout@v4
with:
path: main
- name: Checking out the data branch
uses: actions/checkout@v4
with:
path: data
ref: data
- name: Checking out the website branch
uses: actions/checkout@v4
with:
path: website
ref: website
- name: Setup
uses: ./main/.github/actions/nix-common-setup
with:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Scrape google trends data
run: |
mkdir -p data/gtrends
nix run ./main -- scrape-gtrends \
> data/gtrends.json
- name: Process scraped google trends data
run: |
nix run ./main -- process-gtrends --data ./data/gtrends.json --graphs-out website/data-gtrends.json --victoriametrics-out data/victoriametrics/gtrends.jsonl
- name: Commit metrics to data branch
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Daily scrape of google trends data
repository: ./data
branch: data
file_pattern: 'gtrends.json victoriametrics/gtrends.jsonl'
commit_user_name: NixOS webmaster
commit_user_email: [email protected]
commit_author: GitHub Actions <[email protected]>
if: github.repository == 'NixOS/nixos-metrics'
- name: Commit processed data to website branch
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Daily generation of google trends graph
repository: ./website
branch: website
file_pattern: data-gtrends.json
commit_user_name: NixOS webmaster
commit_user_email: [email protected]
commit_author: GitHub Actions <[email protected]>
if: github.repository == 'NixOS/nixos-metrics'