.github/workflows/cron-tasks.yml #195
This file contains 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
on: | |
# Once a week or on pushes to master | |
schedule: | |
- cron: "0 3 * * 0" | |
push: | |
branches: | |
- main | |
jobs: | |
update_index: | |
name: Update index file | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-node@v2 | |
- name: Install Dependencies | |
run: npm install | |
- name: Set up Git | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
- name: Update index.bson.br | |
run: npm run make-index | |
- name: Verify readability index.bson.br | |
run: npm run show-index | |
- name: Commit index.bson.br changes | |
run: | | |
git commit --no-allow-empty -m "chore: update index.bson.br" index.bson.br || true | |
- name: Push updates | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |