mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Merge pull request #44 from iptv-org/update-github-workflow
Update GitHub workflow
This commit is contained in:
commit
c081198566
2 changed files with 63 additions and 18 deletions
11
.github/workflows/auto-update.yml
vendored
11
.github/workflows/auto-update.yml
vendored
|
@ -51,6 +51,7 @@ jobs:
|
||||||
name: .gh-pages
|
name: .gh-pages
|
||||||
path: .gh-pages/guides/${{ matrix.site }}.guide.xml
|
path: .gh-pages/guides/${{ matrix.site }}.guide.xml
|
||||||
deploy:
|
deploy:
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
needs: grab
|
needs: grab
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -58,6 +59,12 @@ jobs:
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Download Artifacts
|
- name: Download Artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
|
- name: Generate Token
|
||||||
|
uses: tibdex/github-app-token@v1
|
||||||
|
id: generate-token
|
||||||
|
with:
|
||||||
|
app_id: ${{ secrets.APP_ID }}
|
||||||
|
private_key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
uses: JamesIves/github-pages-deploy-action@4.1.1
|
uses: JamesIves/github-pages-deploy-action@4.1.1
|
||||||
with:
|
with:
|
||||||
|
@ -65,3 +72,7 @@ jobs:
|
||||||
folder: .gh-pages
|
folder: .gh-pages
|
||||||
target-folder: guides
|
target-folder: guides
|
||||||
clean: false
|
clean: false
|
||||||
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
|
git-config-name: iptv-bot
|
||||||
|
git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
|
||||||
|
commit-message: '[Bot] Deploy to GitHub Pages'
|
||||||
|
|
70
.github/workflows/update-codes.yml
vendored
70
.github/workflows/update-codes.yml
vendored
|
@ -4,11 +4,27 @@ on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * *'
|
- cron: '0 0 * * *'
|
||||||
jobs:
|
jobs:
|
||||||
update:
|
create-branch:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.ref }}
|
||||||
|
- name: Create Branch
|
||||||
|
uses: peterjgrainger/action-create-branch@v2.0.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
branch: 'bot/update-codes'
|
||||||
|
update-codes:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: create-branch
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: bot/update-codes
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
- name: Update Codes
|
- name: Update Codes
|
||||||
|
@ -18,16 +34,36 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: codes.csv
|
name: codes.csv
|
||||||
path: codes.csv
|
path: codes.csv
|
||||||
|
commit-changes:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: update-codes
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: bot/update-codes
|
||||||
|
- name: Download Artifacts
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: codes.csv
|
||||||
|
- name: Commit Changes
|
||||||
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
|
with:
|
||||||
|
commit_message: '[Bot] Update codes'
|
||||||
|
commit_user_name: iptv-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>'
|
||||||
|
branch: bot/update-codes
|
||||||
|
file_pattern: codes.csv
|
||||||
pull-request:
|
pull-request:
|
||||||
needs: update
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
needs: commit-changes
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Download codes.csv
|
|
||||||
uses: actions/download-artifact@v2
|
|
||||||
with:
|
with:
|
||||||
name: codes.csv
|
ref: bot/update-codes
|
||||||
- name: Generate Token
|
- name: Generate Token
|
||||||
uses: tibdex/github-app-token@v1
|
uses: tibdex/github-app-token@v1
|
||||||
id: generate-token
|
id: generate-token
|
||||||
|
@ -36,26 +72,24 @@ jobs:
|
||||||
private_key: ${{ secrets.APP_PRIVATE_KEY }}
|
private_key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
id: pr
|
id: pr
|
||||||
uses: peter-evans/create-pull-request@v3
|
uses: repo-sync/pull-request@v2
|
||||||
with:
|
with:
|
||||||
title: '[Bot] Update codes'
|
source_branch: 'bot/update-codes'
|
||||||
body: |
|
destination_branch: 'master'
|
||||||
This pull request is created automatically by `update-codes` action.
|
pr_title: '[Bot] Update codes'
|
||||||
commit-message: '[Bot] Update codes'
|
pr_body: |
|
||||||
committer: GitHub <noreply@github.com>
|
This pull request is created by [update-codes][1] workflow.
|
||||||
branch: bot/update-codes
|
|
||||||
delete-branch: true
|
[1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
github_token: ${{ steps.generate-token.outputs.token }}
|
||||||
- name: Enable Pull Request Automerge
|
- name: Enable Pull Request Automerge
|
||||||
if: steps.pr.outputs.pull-request-operation == 'created'
|
|
||||||
uses: peter-evans/enable-pull-request-automerge@v1
|
uses: peter-evans/enable-pull-request-automerge@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
pull-request-number: ${{ steps.pr.outputs.pull-request-number }}
|
pull-request-number: ${{ steps.pr.outputs.pr_number }}
|
||||||
merge-method: squash
|
merge-method: squash
|
||||||
- name: Approve Pull Request
|
- name: Approve Pull Request
|
||||||
if: steps.pr.outputs.pull-request-operation == 'created'
|
|
||||||
uses: juliangruber/approve-pull-request-action@v1
|
uses: juliangruber/approve-pull-request-action@v1
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.PAT }}
|
github-token: ${{ secrets.PAT }}
|
||||||
number: ${{ steps.pr.outputs.pull-request-number }}
|
number: ${{ steps.pr.outputs.pr_number }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue