-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.62 KB
/
main.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
name: Turkiye Fire Data Workflow
on:
workflow_dispatch: # Allows manual triggering from the GitHub UI
schedule:
- cron: '0 */4 * * *' # Run every 3 hours
jobs:
fire_data:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
# Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
# Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# Run the Python script
- name: Fetch Turkey Fire Data
run: python main.py
env:
MAP_KEY_1: ${{ secrets.MAP_KEY_1 }}
MAP_KEY_2: ${{ secrets.MAP_KEY_2 }}
MAP_KEY_3: ${{ secrets.MAP_KEY_3 }}
MAP_KEY_4: ${{ secrets.MAP_KEY_4 }}
MAP_KEY_5: ${{ secrets.MAP_KEY_5 }}
MAP_KEY_6: ${{ secrets.MAP_KEY_6 }}
# Run the update_readme.py script to update README.md with the latest fire data
- name: Update README with Fire Data
run: python update_readme.py
# Commit and push changes
- name: Commit and push changes
run: |-
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add --force available_satellites.txt country_codes.txt
git add -A
timestamp=$(date '+%Y-%m-%d %H:%M:%S')
git commit -m "Auto-update fire data ${timestamp}" || exit 0
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}