Repository navigation
GitHub Actions FundingRate Bot #24912
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: 'GitHub Actions FundingRate Bot' | |
| on: | |
| push: | |
| schedule: | |
| # Run every 2 hours | |
| - cron: '0 */2 * * *' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v2-beta | |
| with: | |
| node-version: '14' | |
| - run: npm install | |
| - run: npm run prepare | |
| - name: Retrieve funding rates | |
| run: | | |
| node ./dist/index.js | |
| - name: Commit files | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add ./data/ | |
| git diff-index --quiet HEAD || git commit -m "Added new data by Github Action" -a | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| force: true |