Skip to content

Fetch exchange rates #1591

Fetch exchange rates

Fetch exchange rates #1591

Workflow file for this run

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