Skip to content

Rename fetch_v2.yml to fetch.yml #18

Rename fetch_v2.yml to fetch.yml

Rename fetch_v2.yml to fetch.yml #18

Workflow file for this run

name: Fetch exchange rates v2
on:
workflow_dispatch:
schedule:
- cron: '00 18 * * *'
push:
branches:
- exchange-rates
env:
APP_ID: ${{ secrets.APP_ID }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
ref: exchange-rates
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install requests
- name: Run fetch-rates.py script
run: python fetch-rates.py
- name: Fetch fiat
run: curl -X GET "https://openexchangerates.org/api/latest.json?app_id=${{ secrets.APP_ID }}" --output core/data/src/main/assets/fiat-rates.json
- name: Move JSON file to assets directory
run: mv crypto-rates.json core/data/src/main/assets/
- name: Push into Git
run: |-
git config --global user.email "[email protected]"
git config --global user.name "ARK Builders Bot"
git add core/data/src/main/assets/fiat-rates.json
git add core/data/src/main/assets/crypto-rates.json
git commit -m "Automated update of rates" || echo "Nothing to commit"
git pull origin exchange-rates --no-edit
git push origin exchange-rates