-
Notifications
You must be signed in to change notification settings - Fork 13
45 lines (42 loc) · 1.94 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
# This workflow runs the main script, fetches new data from all the available sources (except Instagram) and eventually posts updates on Twitter
name: Update All
on:
schedule:
- cron: "*/10 * * * *" # Runs every 10 minutes, everyday (actual timing may vary, depending on GitHub)
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
concurrency: update_flow # Using a concurrency group to avoid two workflows to run together
steps:
- name: checkout repo content # Checkout the repository content to GitHub runner
uses: actions/checkout@v2
- name: setup python # Install Python
uses: actions/setup-python@v2
with:
python-version: 3.8 # The script actually runs fine with Python 3.8
- name: install pip # Install pip
run: |
python -m pip install --upgrade pip
- name: install requirements # Install external modules
run: |
pip3 install -r requirements.txt
- name: execute py script # Run the script to fetch the latest data
run: |
python main.py -no-instagram -no-radio
env: # API KEYs are passed as environment variables. For more info https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_KEY: ${{ secrets.TWITTER_ACCESS_KEY }}
TWITTER_ACCESS_SECRET: ${{ secrets.TWITTER_ACCESS_SECRET }}
SPOTIPY_CLIENT_ID: ${{ secrets.SPOTIPY_CLIENT_ID }}
SPOTIPY_CLIENT_SECRET: ${{ secrets.SPOTIPY_CLIENT_SECRET }}
- name: Commit changes # Commit changes to the master branch
run: |
git config --global user.name 'marco97pa'
git config --global user.email 'marco97pa@live.it'
git add .
git commit -m "Updated data.yaml"
git push
continue-on-error: true