forked from kshitij-raj-sharma/OSMSG-stats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.yml
50 lines (45 loc) · 1.84 KB
/
sample.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
name: Run Daily Report REPLACE_ME_WITH_HASHTAG Hashtag
on:
schedule:
- cron: "0 3 * * *" # Run every day at 3 UTC
jobs:
issue:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Osmium
run: sudo apt-get install -y osmium-tool
- name: Install necessary dependecies
run: |
pip install flare-floss
pip install -e .
pip install tweepy
pip install -r requirements.txt
- name: Generate Daily Hashtag REPLACE_ME_WITH_HASHTAG Stats
run: |
osmsg --format csv image --tags 'building' 'highway' 'waterway' 'amenity' --name stats --all_tags --hashtags REPLACE_ME_WITH_HASHTAG --charts --summary --length highway --update --name stats/REPLACE_ME_WITH_HASHTAG/Daily/stats --force
- name: add stats to git
run: |
git pull
git config --global user.email "[email protected]"
git config --global user.name "kshitijrajsharma"
base_dir=stats/REPLACE_ME_WITH_HASHTAG/Daily
mkdir -p $base_dir
mv $base_dir/stats_summary.md $base_dir/Readme.md
git add -f $base_dir/*
git commit -m "Updated Daily REPLACE_ME_WITH_HASHTAG stats"
git push
- name : Tweet stats
env:
API_KEY: ${{ secrets.API_KEY }}
API_KEY_SECRET: ${{ secrets.API_KEY_SECRET }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
BEARER_TOKEN: ${{ secrets.BEARER_TOKEN }}
run : |
commit_id=$(git rev-parse --short HEAD)
python tweet.py --git $commit_id --tweet '#REPLACE_ME_WITH_HASHTAG' --name stats/REPLACE_ME_WITH_HASHTAG/Daily/stats