Skip to content

update

update #1276

Workflow file for this run

name: update
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
permissions:
packages: read
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tibdex/[email protected]
if: ${{ !env.ACT }}
id: create-app-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
if: ${{ !env.ACT }}
with:
token: ${{ steps.create-app-token.outputs.token }}
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Setup .npmrc for GitHub Packages
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
echo "@iptv-org:registry=https://npm.pkg.github.com/" >> .npmrc
echo "always-auth=true" >> .npmrc
- name: Install dependencies
run: npm install
- name: Update internal playlists
run: npm run playlist:update --silent >> $GITHUB_OUTPUT
id: playlist-update
- name: Check internal playlists
run: |
npm run playlist:lint
npm run playlist:validate
- name: Generate public playlists
run: npm run playlist:generate
- name: Generate .api/streams.json
run: npm run api:generate
- name: Update readme
run: npm run readme:update
- name: Setup git
run: |
git config user.name "iptv-bot[bot]"
git config user.email "84861620+iptv-bot[bot]@users.noreply.github.com"
- name: Commit changes to /streams
run: |
git add streams
git status
git commit --allow-empty -m "[Bot] Update /streams" -m "Committed by [iptv-bot](https://github.com/apps/iptv-bot) via [update](https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}) workflow." -m "${{ steps.playlist-update.outputs.OUTPUT }}" --no-verify
- name: Commit changes to PLAYLIST.md
run: |
git add PLAYLISTS.md
git status
git commit --allow-empty -m "[Bot] Update PLAYLISTS.md" -m "Committed by [iptv-bot](https://github.com/apps/iptv-bot) via [update](https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}) workflow." --no-verify
- name: Push all changes to the repository
if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
run: git push
- name: Deploy public playlists to GitHub Pages
uses: JamesIves/[email protected]
if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
with:
repository-name: iptv-org/iptv
branch: gh-pages
folder: .gh-pages
token: ${{ steps.create-app-token.outputs.token }}
git-config-name: iptv-bot[bot]
git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
commit-message: '[Bot] Deploy to GitHub Pages'
clean: true
- name: Move .api/streams.json to iptv-org/api
uses: JamesIves/[email protected]
if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
with:
repository-name: iptv-org/api
branch: gh-pages
folder: .api
token: ${{ steps.create-app-token.outputs.token }}
git-config-name: iptv-bot[bot]
git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
commit-message: '[Bot] Deploy to iptv-org/api'
clean: false