Update auto-update.yml

pull/3870/head
Aleksandr Statciuk 3 years ago
parent 93aa4cd31f
commit b0fcb71a58

@ -293,6 +293,8 @@ jobs:
ref: bot/auto-update ref: bot/auto-update
- name: Download Artifacts - name: Download Artifacts
uses: actions/download-artifact@v2 uses: actions/download-artifact@v2
with:
name: channels
- name: Commit Changes - name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v4 uses: stefanzweifel/git-auto-commit-action@v4
with: with:
@ -310,22 +312,40 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
ref: bot/auto-update ref: bot/auto-update
- name: Install Dependencies
run: npm install
- name: Generate Playlists
run: node scripts/generate.js
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: gh-pages
path: .gh-pages/
deploy:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
needs: generate
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: bot/auto-update
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: gh-pages
- name: Generate Token - name: Generate Token
uses: tibdex/github-app-token@v1 uses: tibdex/github-app-token@v1
id: gh-pages-token id: generate-token
with: with:
app_id: ${{ secrets.APP_ID }} app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }} private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Install Dependencies
run: npm install
- name: Generate Playlists
run: node scripts/generate.js
- 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:
branch: gh-pages branch: gh-pages
folder: .gh-pages folder: .gh-pages
token: ${{ steps.gh-pages-token.outputs.token }} token: ${{ steps.generate-token.outputs.token }}
git-config-name: iptv-bot git-config-name: iptv-bot
git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
commit-message: '[Bot] Deploy to GitHub Pages' commit-message: '[Bot] Deploy to GitHub Pages'
@ -360,7 +380,7 @@ jobs:
ref: bot/auto-update ref: bot/auto-update
- name: Generate Token - name: Generate Token
uses: tibdex/github-app-token@v1 uses: tibdex/github-app-token@v1
id: pr-token id: generate-token
with: with:
app_id: ${{ secrets.APP_ID }} app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }} private_key: ${{ secrets.APP_PRIVATE_KEY }}
@ -374,18 +394,18 @@ jobs:
https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }} https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}
committer: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>' committer: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>'
branch: bot/auto-update branch: bot/auto-pull-request
delete-branch: true delete-branch: true
token: ${{ steps.pr-token.outputs.token }} token: ${{ steps.pr-token.outputs.token }}
- name: Enable Pull Request Automerge - name: Enable Pull Request Automerge
if: steps.pr.outputs.pull-request-operation == 'created' if: steps.generate-token.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.pull-request-number }}
merge-method: squash merge-method: squash
- name: Approve Pull Request - name: Approve Pull Request
if: steps.pr.outputs.pull-request-operation == 'created' if: github.ref == 'refs/heads/master' && 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 }}

Loading…
Cancel
Save