diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml deleted file mode 100644 index bb4f84bc..00000000 --- a/.github/workflows/auto-update.yml +++ /dev/null @@ -1,150 +0,0 @@ -name: auto-update -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' -jobs: - setup: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Delete .artifacts/ folder - if: ${{ env.ACT }} - run: rm -rf .artifacts/ - - name: Download data from API - run: | - mkdir -p scripts/data - curl -L -o scripts/data/channels.json https://iptv-org.github.io/api/channels.json - curl -L -o scripts/data/countries.json https://iptv-org.github.io/api/countries.json - curl -L -o scripts/data/subdivisions.json https://iptv-org.github.io/api/subdivisions.json - - uses: actions/upload-artifact@v2 - with: - name: data - path: scripts/data - - uses: actions/setup-node@v2 - if: ${{ !env.ACT }} - with: - node-version: '14' - cache: 'npm' - - run: npm install - - run: node scripts/commands/create-queue.js --max-clusters=256 --days=2 - - run: node scripts/commands/create-matrix.js - id: create-matrix - - uses: actions/upload-artifact@v2 - with: - name: database - path: scripts/database - outputs: - matrix: ${{ steps.create-matrix.outputs.matrix }} - load: - runs-on: ubuntu-latest - needs: setup - continue-on-error: true - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.setup.outputs.matrix) }} - # matrix: - # cluster_id: [1] - steps: - - uses: actions/checkout@v2 - - uses: actions/download-artifact@v2 - with: - name: database - path: scripts/database - - uses: FedericoCarboni/setup-ffmpeg@v1 - - uses: actions/setup-node@v2 - if: ${{ !env.ACT }} - with: - node-version: '14' - - run: npm install - - run: NODE_OPTIONS=--insecure-http-parser node scripts/commands/load-cluster.js --timeout=30000 --cluster-id=${{ matrix.cluster_id }} - - uses: actions/upload-artifact@v2 - with: - name: logs - path: scripts/logs - update: - runs-on: ubuntu-latest - needs: load - steps: - - uses: actions/checkout@v2 - - run: echo "::set-output name=branch_name::$(date +'bot/auto-update-%s')" - id: create-branch-name - - run: git config user.name 'iptv-bot[bot]' - - run: git config user.email '84861620+iptv-bot[bot]@users.noreply.github.com' - - run: git checkout -b ${{ steps.create-branch-name.outputs.branch_name }} - - uses: actions/download-artifact@v2 - with: - name: database - path: scripts/database - - uses: actions/download-artifact@v2 - with: - name: data - path: scripts/data - - uses: actions/download-artifact@v2 - with: - name: logs - path: scripts/logs - - uses: actions/setup-node@v2 - if: ${{ !env.ACT }} - with: - node-version: '14' - - run: npm install - - run: node scripts/commands/save-results.js - - run: NODE_OPTIONS="--max-old-space-size=4096" node scripts/commands/update-guides.js - - run: NODE_OPTIONS="--max-old-space-size=4096" node scripts/commands/update-api.js - - uses: actions/upload-artifact@v2 - with: - name: database - path: scripts/database - - uses: actions/upload-artifact@v2 - with: - name: logs - path: scripts/logs - - uses: actions/upload-artifact@v2 - with: - name: errors - path: scripts/logs/errors - - uses: actions/upload-artifact@v2 - with: - name: programs.json - path: .gh-pages/api/programs.json - - run: node scripts/commands/update-readme.js - - name: Commit changes in README.md - if: ${{ !env.ACT }} - run: | - git add README.md - git commit -m "[Bot] Update README.md" - git push -u origin ${{ steps.create-branch-name.outputs.branch_name }} - - uses: tibdex/github-app-token@v1 - if: ${{ !env.ACT }} - id: create-app-token - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - - uses: repo-sync/pull-request@v2 - if: ${{ !env.ACT }} - id: pull-request - with: - github_token: ${{ steps.create-app-token.outputs.token }} - source_branch: ${{ steps.create-branch-name.outputs.branch_name }} - destination_branch: 'master' - pr_title: '[Bot] Daily update' - pr_body: | - This pull request is created by [auto-update][1] workflow. - - [1]: https://github.com/iptv-org/epg/actions/runs/${{ github.run_id }} - - uses: juliangruber/merge-pull-request-action@v1 - if: ${{ !env.ACT && github.ref == 'refs/heads/master' }} - with: - github-token: ${{ secrets.PAT }} - number: ${{ steps.pull-request.outputs.pr_number }} - method: squash - - uses: JamesIves/github-pages-deploy-action@4.1.1 - if: ${{ !env.ACT && github.ref == 'refs/heads/master' }} - with: - 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'