Run Playlist Script #834
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "actions-user" | |
git config user.email "actions@github.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 |