From 7a2dab3a2cff299eef8082e91ca3839bed37b7bc 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.yml | 25 +++++++++++++++++++++++ .github/workflows/update_rates_job.yml | 11 ++++++++++ .github/workflows/update_rates_manual.yml | 10 +++++++++ .python-version | 1 + 4 files changed, 47 insertions(+) create mode 100644 .github/workflows/update_rates.yml 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.yml b/.github/workflows/update_rates.yml new file mode 100644 index 00000000..86d346d1 --- /dev/null +++ b/.github/workflows/update_rates.yml @@ -0,0 +1,25 @@ +name: Update Rates + +on: + workflow_call + +jobs: + update-rates: + runs-on: [ ubuntu-latest ] + steps: + - name: Setup Git + run: | + git config user.email "ci-build@matchilling.com" + git config user.name "ci-build" + git config --list + + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + - 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_job.yml b/.github/workflows/update_rates_job.yml new file mode 100644 index 00000000..bf024961 --- /dev/null +++ b/.github/workflows/update_rates_job.yml @@ -0,0 +1,11 @@ +# GitHub Actions documentation +# => https://docs.github.com/en/actions +name: Update Rates Cron Job + +on: + schedule: + - cron: '0 3 * * *' + +jobs: + update-rates: + uses: ./.github/workflows/update_rates.yml \ 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..be941543 --- /dev/null +++ b/.github/workflows/update_rates_manual.yml @@ -0,0 +1,10 @@ +# GitHub Actions documentation +# => https://docs.github.com/en/actions +name: Update Rates Manual + +on: + workflow_dispatch + +jobs: + update-rates: + uses: ./.github/workflows/update_rates.yml \ 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