From 6ced93bcdbd25b304781bd5e3742e4bd13c22a16 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Wed, 26 May 2021 15:58:54 +0300 Subject: [PATCH] Update auto-update.yml --- .github/workflows/auto-update.yml | 77 ++++++++++++++++++------------- 1 file changed, 45 insertions(+), 32 deletions(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index eed67fdcc..1365fef0d 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -4,33 +4,47 @@ on: schedule: - cron: '0 0 * * *' jobs: - update: + remove-duplicates: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - - name: Update Config - run: | - git config user.name github-actions - git config user.email github-actions@github.com - - name: Create Branch - run: | - git fetch --prune --unshallow - git checkout bot/auto-update || git checkout -b bot/auto-update - name: Install Dependencies run: npm install - name: Remove Duplicates run: node scripts/remove-duplicates.js - - name: Commit Changes - run: | - git add channels/* - git diff-index --quiet HEAD || git commit -m "[Bot] Remove duplicates" + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: channels + path: channels/ + format: + runs-on: ubuntu-latest + needs: remove-duplicates + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Download Artifacts + uses: actions/download-artifact@v2 + - name: Install Dependencies + run: npm install - name: Format Playlists run: node scripts/format.js - - name: Commit Changes - run: | - git add channels/* - git diff-index --quiet HEAD || git commit -m "[Bot] Format playlists" + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: channels + path: channels/ + generate: + runs-on: ubuntu-latest + needs: format + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Download Artifacts + uses: actions/download-artifact@v2 + - name: Install Dependencies + run: npm install - name: Generate Playlists run: node scripts/generate.js - name: Deploy to GitHub Pages @@ -38,21 +52,20 @@ jobs: with: branch: gh-pages folder: .gh-pages + update-readme: + runs-on: ubuntu-latest + needs: generate + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Download Artifacts + uses: actions/download-artifact@v2 + - name: Install Dependencies + run: npm install - name: Update README.md run: node scripts/update-readme.js - - name: Commit Changes - run: | - git add README.md - git diff-index --quiet HEAD || git commit -m "[Bot] Update README.md" - - name: Discard Uncommited Changes - run: | - git checkout -- . - - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 + - name: Upload Artifact + uses: actions/upload-artifact@v2 with: - title: '[Bot] Update Playlists' - body: | - This pull request is created automatically by `auto-update` action. - base: bot/auto-update - branch: bot/auto-update-pr - delete-branch: true + name: README.md + path: README.md