-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (37 loc) · 1.36 KB
/
reddit_scraper.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
name: Reddit Stash Scraper
on:
schedule:
- cron: "0 23 * * *" # Adjust according to your desired schedule (e.g., 23:00 UTC for midnight CET)
workflow_dispatch: # Allows manual trigger of the workflow
jobs:
run-script:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Download existing Reddit data from Dropbox
env:
DROPBOX_TOKEN: ${{ secrets.DROPBOX_TOKEN }}
run: |
python dropbox_utils.py --download # Add a command-line option to control what the script does
- name: Run Reddit Stash Script
env:
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }}
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }}
REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }}
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }}
run: |
python reddit_stash.py # Run the Reddit processing script
- name: Upload updated Reddit data to Dropbox
env:
DROPBOX_TOKEN: ${{ secrets.DROPBOX_TOKEN }}
run: |
python dropbox_utils.py --upload # Another command-line option for the upload process