Run daily cron script #45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run daily cron script | |
| on: | |
| workflow_dispatch: # Manual testing | |
| schedule: | |
| - cron: "0 0 * * *" | |
| jobs: | |
| daily: | |
| if: ${{ 'chakra-ui/chakra-ui' == github.repository }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get Yarn cache path | |
| id: yarn-cache | |
| run: echo "::set-output name=dir::$(yarn cache dir)" | |
| - name: Checkout | |
| uses: actions/checkout@master | |
| with: | |
| ref: main | |
| - name: Enable node | |
| uses: actions/setup-node@master | |
| with: | |
| node-version: 14.x | |
| - name: Load Yarn cache | |
| uses: actions/cache@v2 | |
| with: | |
| path: ${{ steps.yarn-cache.outputs.dir }} | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile && yarn bootstrap | |
| - name: Setup Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Generate avatars and all-sponsorsrc | |
| run: yarn avatars:gen | |
| - name: Commit avatars and all-sponsorsrc | |
| run: | | |
| git add website/public/avatars | |
| git diff --staged --quiet || git commit -m "chore(avatars): $GITHUB_SHA" | |
| git add .all-sponsorsrc | |
| git diff --staged --quiet || git commit -m "chore(.all-sponsorsrc): $GITHUB_SHA" | |
| - name: Generate all-membersrc | |
| run: yarn members:gen | |
| - name: Commit all-membersrc | |
| run: | | |
| git add .all-membersrc | |
| git diff --staged --quiet || git commit -m "chore(.all-membersrc): $GITHUB_SHA" | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v3 | |
| with: | |
| delete-branch: true | |
| title: update sponsors, members and avatars | |
| branch: chore/daily-updates |