-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (51 loc) · 1.86 KB
/
podcast.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
55
56
57
58
59
60
61
62
name: Upload Podcast
on:
schedule:
- cron: '0 4 * * 2-6' # This runs at 4 AM UTC Tuesday to Saturday, which is 8 PM PST the previous day, Monday to Friday
workflow_dispatch: # Allows manual triggering
jobs:
build:
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.12.0' # Specify the Python version you need
- name: Install ffmpeg
run: sudo apt-get update && sudo apt-get install -y ffmpeg
- name: Read current count
id: read_count
run: |
if [ ! -f count.txt ]; then
echo "0" > count.txt
fi
count=$(cat count.txt)
echo "current_count=$count" >> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Upload Podcast [${{ env.current_count }}]
env:
PODBEAN_CLIENT_ID: ${{ secrets.PODBEAN_CLIENT_ID }}
PODBEAN_CLIENT_SECRET: ${{ secrets.PODBEAN_CLIENT_SECRET }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
python main.py ${{ env.current_count }}
- name: Increment count
id: increment
run: |
new_count=$((current_count + 1))
echo $new_count > count.txt
echo "new_count=$new_count" >> $GITHUB_ENV
- name: Commit and push new files
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Add new files created by upload script"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}