-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (68 loc) · 2.57 KB
/
netlify-daily.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Based on example from
# https://github.com/NiklasMerz/netlify-analytics-collector/tree/main/.github/workflows
name: Netlify - Daily run
on:
schedule:
- cron: '55 23 * * *'
workflow_dispatch:
jobs:
export-run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: niklasmerz/[email protected]
with:
netlify-token: ${{ secrets.NETLIFY_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE }}
- uses: actions/upload-artifact@v3
with:
name: exports
path: '*.csv'
sheet-upload:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: netlify-stats
- uses: niklasmerz/[email protected]
with:
netlify-token: ${{ secrets.NETLIFY_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE }}
days: -1
disable-header: true
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
add: '*.csv'
message: "[ci skip] fluxcd.io stats from netlify-analytics"
#signoff: true
#new_branch: netlify-stats
- uses: kingdonb/[email protected]
with:
csv_path: pageviews.csv
spreadsheet_id: ${{ secrets.google_spreadsheet_id }}
worksheet: 0
append_content: true
# The credential is from the "kingdon-flux-netlify-exporter" account in dx-kingdon project
# that is also known as: '[email protected]'
# (It has no permissions except that it has been shared the doc above, with editor access.)
google_service_account_email: ${{ secrets.google_service_account_email }}
google_service_account_private_key: ${{ secrets.google_service_account_private_key }}
- uses: kingdonb/[email protected]
with:
csv_path: visitors.csv
spreadsheet_id: ${{ secrets.google_spreadsheet_id }}
worksheet: 1
append_content: true
google_service_account_email: ${{ secrets.google_service_account_email }}
google_service_account_private_key: ${{ secrets.google_service_account_private_key }}
- uses: kingdonb/[email protected]
with:
csv_path: bandwidth.csv
spreadsheet_id: ${{ secrets.google_spreadsheet_id }}
worksheet: 2
append_content: true
google_service_account_email: ${{ secrets.google_service_account_email }}
google_service_account_private_key: ${{ secrets.google_service_account_private_key }}