-
Notifications
You must be signed in to change notification settings - Fork 58
52 lines (42 loc) · 1.35 KB
/
stats-actions.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
name: Update Stats
on:
workflow_dispatch:
schedule:
- cron: '46 15 * * *'
jobs:
build:
permissions: write-all
runs-on: macos-latest
steps:
- name: install gdal
run: brew install gdal
- name: get current date and time
run: echo "RUN=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
- name: checkout repo
uses: actions/checkout@v2
- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.10.8'
- name: install python packages
run: |
python -m pip install --upgrade pip
pip install gdal==3.6.4
pip install -r ./.github/requirements.txt
- name: execute python script
env:
SITE: navendu.me
PERIOD: 30d
TOKEN: ${{ secrets.PLAUSIBLE_TOKEN }}
run: python ./.github/main.py
- name: commit files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git diff-index --quiet HEAD || (git commit -a -m "update stats" --allow-empty)
- name: push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: hugo