Fetch exchange rates #1599
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
name: Fetch exchange rates | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0,8,16 * * *" | |
env: | |
APP_ID: ${{ secrets.APP_ID }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Fetch fiat | |
run: curl -X GET "https://openexchangerates.org/api/latest.json?app_id=${{ secrets.APP_ID }}" --output fiat-rates.json | |
- name: Fetch crypto | |
run: curl -X GET "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd" --output crypto-rates.json | |
- name: Push into Git | |
run: |- | |
git config --global user.email "[email protected]" | |
git config --global user.name "ARK Builders Bot" | |
git add fiat-rates.json | |
git add crypto-rates.json | |
git commit -m "Automated update of rates" | |
git push |