From e5ff543d95d2b9e32af06eeb026b2d17135c3342 Mon Sep 17 00:00:00 2001 From: Kirill Taran Date: Wed, 12 Mar 2025 14:49:48 +0700 Subject: [PATCH] [WIP] job to fetch the fallback exchange rates --- .github/workflows/fetch.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/fetch.yml diff --git a/.github/workflows/fetch.yml b/.github/workflows/fetch.yml new file mode 100644 index 0000000..7488450 --- /dev/null +++ b/.github/workflows/fetch.yml @@ -0,0 +1,33 @@ +name: Fetch exchange rates + +on: + push: + branches: [ "main" ] # On every push to `main` + workflow_dispatch: + schedule: + - cron: "0 0 * * 1" # Also, regularly at 00:00 on Monday + +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 # ADJUST PATH HERE + + - name: Fetch crypto + run: curl -X GET "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd" --output crypto-rates.json # ADJUST PATH HERE + + - name: Push into Git + run: |- + git config --global user.email "bot@ark-builders.dev" + git config --global user.name "ARK Builders Bot" + git add fiat-rates.json # ADJUST PATH HERE + git add crypto-rates.json # ADJUST PATH HERE + git commit -m "Automated update of rates" + git push