mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2026-08-13 12:33:07 +02:00
Create traffic-exporter.yml
automated metrics extraction
This commit is contained in:
parent
7340cb390a
commit
c27f4aff45
1 changed files with 37 additions and 0 deletions
37
.github/workflows/traffic-exporter.yml
vendored
Normal file
37
.github/workflows/traffic-exporter.yml
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
name: Export Repo Traffic to Google Sheets
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Runs at 02:00 UTC every day
|
||||
- cron: '0 2 * * *'
|
||||
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install gspread oauth2client requests
|
||||
|
||||
- name: Write Google credentials to a file
|
||||
id: write_creds
|
||||
uses: timheuer/base64-to-file@v1.2
|
||||
with:
|
||||
fileName: 'google-credentials.json'
|
||||
encodedString: ${{ secrets.GOOGLE_SHEETS_CREDENTIALS }}
|
||||
|
||||
- name: Run the Python script
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
GOOGLE_SHEETS_CREDENTIALS: ${{ steps.write_creds.outputs.filePath }}
|
||||
run: python export_traffic.py
|
||||
Loading…
Add table
Add a link
Reference in a new issue