42 lines
1010 B
YAML
42 lines
1010 B
YAML
name: Get Currencies
|
|
|
|
# This workflow is triggered on cron schedule
|
|
# every 5 minutes
|
|
on:
|
|
schedule:
|
|
- cron: '*/5 * * * *'
|
|
|
|
jobs:
|
|
update-currencies:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: master
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.9'
|
|
|
|
- name: Install Bonbast
|
|
run: pip install -U bonbast
|
|
|
|
- name: Export Currencies Data to JSON
|
|
run: |
|
|
for i in {1..3}; do
|
|
bonbast export > currencies.json && break || sleep 10
|
|
done
|
|
cat currencies.json
|
|
|
|
- name: Commit and Push
|
|
run: |
|
|
git config --local user.email "action@github.com"
|
|
git config --local user.name "GitHub Action"
|
|
git add currencies.json
|
|
git commit -m "Update currencies data"
|
|
git push
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |