From 42739c069282f67fd03dfe1977fdf3537d4c2934 Mon Sep 17 00:00:00 2001 From: dcjohnson24 Date: Tue, 24 Oct 2023 19:24:46 -0500 Subject: [PATCH] Download data from s3 --- .github/workflows/download-data.yml | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/download-data.yml diff --git a/.github/workflows/download-data.yml b/.github/workflows/download-data.yml new file mode 100644 index 00000000..42e3597a --- /dev/null +++ b/.github/workflows/download-data.yml @@ -0,0 +1,44 @@ +name: download-data + +on: + schedule: + # Run everyday at 2:00pm CST which is 7:00pm UTC + - cron: 0 19 * * * + + # Allows the workflow to be run manually from the Actions tab + workflow_dispatch: + + push: + branches: + - github-action + + +jobs: + download-data-json: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - run: | + wget https://chn-ghost-buses-public.s3.us-east-2.amazonaws.com/frontend_data_files/data.json \ + -P src/Routes/ + wget \ + https://chn-ghost-buses-public.s3.us-east-2.amazonaws.com/frontend_data_files/schedule_vs_realtime_all_day_types_routes.json \ + -P src/Routes/ + + commit-changes: + needs: download-data-json + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + # Change the branch to main when ready to merge to main. + - run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git diff-index --quiet HEAD || git commit -m "{commit message}" -a + git push origin github-action:github-action + + + + + \ No newline at end of file