From daf5b07af32c3caddc91989348ed8336f0f556db Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 5 Sep 2021 01:49:13 +0300 Subject: [PATCH] Update update-codes.yml --- .github/workflows/update-codes.yml | 43 +++++++++++++++++------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/.github/workflows/update-codes.yml b/.github/workflows/update-codes.yml index 5c6b2cc6..35336e33 100644 --- a/.github/workflows/update-codes.yml +++ b/.github/workflows/update-codes.yml @@ -29,23 +29,6 @@ jobs: run: npm install - name: Update Codes run: npm run update-codes - - name: Upload Artifact - uses: actions/upload-artifact@v2 - with: - name: 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: @@ -54,10 +37,10 @@ jobs: 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 + file_pattern: .gh-pages/_items.json .gh-pages/codes.json pull-request: if: ${{ github.ref == 'refs/heads/master' }} - needs: commit-changes + needs: update-codes runs-on: ubuntu-latest steps: - name: Checkout @@ -93,3 +76,25 @@ jobs: with: github-token: ${{ secrets.PAT }} number: ${{ steps.pr.outputs.pr_number }} + deploy: + needs: pull-request + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@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 + uses: JamesIves/github-pages-deploy-action@4.1.1 + with: + branch: gh-pages + folder: .gh-pages + 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'