From 6fd71c6923fdc24072cde8df3662bb765974015f 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 | 27 +++++++++++++++++++++++ .github/workflows/update_rates_manual.yml | 26 ++++++++++++++++++++++ .python-version | 1 + 3 files changed, 54 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..4b8d5250 --- /dev/null +++ b/.github/workflows/update_rates_job.yml @@ -0,0 +1,27 @@ +# 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 + run: | + git config user.email "ci-build@matchilling.com" + git config user.name "ci-build" + git config --list + + - 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_manual.yml b/.github/workflows/update_rates_manual.yml new file mode 100644 index 00000000..5409fc34 --- /dev/null +++ b/.github/workflows/update_rates_manual.yml @@ -0,0 +1,26 @@ +# 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 + run: | + git config user.email "ci-build@matchilling.com" + git config user.name "ci-build" + git config --list + + - 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/.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