-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (35 loc) · 1.23 KB
/
schedule_playlist.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
name: Run Playlist Script
on:
schedule:
- cron: '0 0 * * *' # At 00:00 (midnight) UTC
- cron: '0 12 * * *' # At 12:00 (noon) UTC
workflow_dispatch: # Manual trigger
jobs:
run-script:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.RUN_ACTIONS }} # Use GITHUB_TOKEN for authentication
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4' # Specify your PHP version
- name: Run Movie Playlist PHP script
run: php php/create_movie_playlist.php
env:
SECRET_API_KEY: ${{ secrets.SECRET_API_KEY }}
- name: Run TV Playlist PHP script
run: php php/create_tv_playlist.php
env:
SECRET_API_KEY: ${{ secrets.SECRET_API_KEY }}
- name: Commit and Push to Public Repository
run: |
git config user.name "gogetta69"
git config user.email "gogetta.teams@gmail.com"
git add playlist.m3u8 playlist.json tv_playlist.json
git commit -m "Update Playlists" || echo "No changes to Playlists"
git push https://x-access-token:${{ secrets.RUN_ACTIONS }}@github.com/gogetta69/public-files.git