From 06878cdfde02a82fa30a1007df18c7cbd0a1a2c6 Mon Sep 17 00:00:00 2001 From: Kyle Dolezal Date: Sat, 2 Dec 2023 18:08:17 -0600 Subject: [PATCH] Create github action for downloading files from s3 --- .github/actions/download-from-s3/action.yml | 13 +++++++++++++ .github/workflows/download-data.yml | 15 ++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 .github/actions/download-from-s3/action.yml diff --git a/.github/actions/download-from-s3/action.yml b/.github/actions/download-from-s3/action.yml new file mode 100644 index 00000000..52f47103 --- /dev/null +++ b/.github/actions/download-from-s3/action.yml @@ -0,0 +1,13 @@ +name: download-from-s3 +description: "Downloads files from s3" +inputs: + file-path: + description: "Path to test script" + required: true +runs: + using: macos-latest + steps: + - uses: actions/checkout@v3 + - run: | + wget https://chn-ghost-buses-public.s3.us-east-2.amazonaws.com/frontend_data_files/${{inputs.file-path}} \ + -O src/Routes/${{inputs.file-path}} diff --git a/.github/workflows/download-data.yml b/.github/workflows/download-data.yml index 5e8bf1b1..4ca5e80f 100644 --- a/.github/workflows/download-data.yml +++ b/.github/workflows/download-data.yml @@ -13,13 +13,14 @@ jobs: 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 \ - -O src/Routes/data.json - wget \ - https://chn-ghost-buses-public.s3.us-east-2.amazonaws.com/frontend_data_files/schedule_vs_realtime_all_day_types_routes.json \ - -O src/Routes/schedule_vs_realtime_all_day_types_routes.json - + - name: download data + uses: ./.github/actions/download-from-s3 + with: + file-path: data.json + - name: download schedule vs realtime + uses: ./.github/actions/download-from-s3 + with: + file-path: schedule_vs_realtime_all_day_types_routes.json - run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action"