From 14e21ad1d9f4486cb69fbb734d4ecaa81bfa0e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20J=2E=20Schilling?= Date: Fri, 3 Nov 2023 10:43:56 +0100 Subject: [PATCH] Add GitHub action --- .github/workflows/update_rates_job.yml | 31 +++++++++++++++++++++++ .github/workflows/update_rates_manual.yml | 30 ++++++++++++++++++++++ .python-version | 1 + 3 files changed, 62 insertions(+) create mode 100644 .github/workflows/update_rates_job.yml create mode 100644 .github/workflows/update_rates_manual.yml create mode 100644 .python-version diff --git a/.github/workflows/update_rates_job.yml b/.github/workflows/update_rates_job.yml new file mode 100644 index 00000000..79281f9c --- /dev/null +++ b/.github/workflows/update_rates_job.yml @@ -0,0 +1,31 @@ +# GitHub Actions documentation +# => https://docs.github.com/en/actions +name: Update Rates Cron Job + +on: + schedule: + - cron: '0 3 * * *' + +jobs: + update-rates: + runs-on: [ ubuntu-latest ] + steps: + - uses: actions/checkout@v3 + + - name: Setup Git + run: | + git config user.email "ci-build@matchilling.com" + git config user.name "ci-build" + git config --list + + - uses: actions/setup-python@v4 + + - name: Update Rates + run: ./script/update.sh + + - name: Push changes + run: | + git status + git add README.md rate/\*.json + git commit --message='[skip ci] Automatic rates update' + git push \ No newline at end of file diff --git a/.github/workflows/update_rates_manual.yml b/.github/workflows/update_rates_manual.yml new file mode 100644 index 00000000..0374e14c --- /dev/null +++ b/.github/workflows/update_rates_manual.yml @@ -0,0 +1,30 @@ +# GitHub Actions documentation +# => https://docs.github.com/en/actions +name: Update Rates Manual + +on: + workflow_dispatch + +jobs: + update-rates: + runs-on: [ ubuntu-latest ] + steps: + - uses: actions/checkout@v3 + + - name: Setup Git + run: | + git config user.email "ci-build@matchilling.com" + git config user.name "ci-build" + git config --list + + - uses: actions/setup-python@v4 + + - name: Update Rates + run: ./script/update.sh + + - name: Push changes + run: | + git status + git add README.md rate/\*.json + git commit --message='[skip ci] Automatic rates update' + git push \ No newline at end of file diff --git a/.python-version b/.python-version new file mode 100644 index 00000000..e3d253d3 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +2.7-7.3.13 \ No newline at end of file