From 4a5a4f03c85486a3b1eb2cca044b10ab90b2aafc Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Fri, 15 Sep 2023 18:40:49 +0300 Subject: [PATCH] Update update.yml --- .github/workflows/update.yml | 50 +++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index e5b3ee34e..3e13b6b69 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -2,7 +2,7 @@ name: update on: workflow_dispatch: schedule: - - cron: '0 */6 * * *' + - cron: '0 0 * * *' jobs: main: runs-on: ubuntu-latest @@ -10,7 +10,7 @@ jobs: contents: write steps: - uses: actions/checkout@v3 - - uses: tibdex/github-app-token@v1 + - uses: getsentry/action-github-app-token@v2 if: ${{ !env.ACT }} id: create-app-token with: @@ -20,7 +20,12 @@ jobs: if: ${{ !env.ACT }} with: token: ${{ steps.create-app-token.outputs.token }} + - name: setup git + run: | + git config user.name "iptv-bot[bot]" + git config user.email "84861620+iptv-bot[bot]@users.noreply.github.com" - uses: actions/setup-node@v3 + if: ${{ !env.ACT }} with: node-version: 18 cache: 'npm' @@ -28,31 +33,36 @@ jobs: run: npm install - name: load api data run: npm run api:load - - name: validate playlists + - name: setup database + run: npm run db:create + - 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: setup database - run: npm run db:create - - name: generate playlists + - name: generate public playlists run: npm run playlist:generate - - name: generate streams.json + - name: generate .api/streams.json run: npm run api:generate - name: update readme.md run: npm run readme:update - - name: commit changes - uses: stefanzweifel/git-auto-commit-action@v4 + - run: git status + - name: commit changes to /streams + run: | + git add streams + git status + git commit -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 readme.md + run: | + git add README.md + git status + git commit -m "[Bot] Update README.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' }} - with: - commit_message: "[Bot] Update README.md" - branch: master - commit_options: '--no-verify' - file_pattern: README.md - repository: . - commit_user_name: iptv-bot[bot] - commit_user_email: 84861620+iptv-bot[bot]@users.noreply.github.com - commit_author: iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com> - - name: deploy to github pages + run: git push + - name: deploy public playlists to github pages uses: JamesIves/github-pages-deploy-action@4.1.1 if: ${{ !env.ACT && github.ref == 'refs/heads/master' }} with: @@ -64,7 +74,7 @@ jobs: git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com commit-message: '[Bot] Deploy to GitHub Pages' clean: true - - name: deploy to iptv-org/api + - name: move .api/streams.json to iptv-org/api uses: JamesIves/github-pages-deploy-action@4.1.1 if: ${{ !env.ACT && github.ref == 'refs/heads/master' }} with: