Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub action #115

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
16 changes: 16 additions & 0 deletions .github/actions/download-from-s3/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: download-from-s3
description: "Downloads files from s3"
inputs:
file-path:
description: "Path to test script"
required: true
runs:
using: composite
steps:
- name: checkout
uses: actions/checkout@v3
- name: download s3 file
shell: bash
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}}
23 changes: 23 additions & 0 deletions .github/workflows/download-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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:

jobs:
download-data-json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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
38,400 changes: 38,132 additions & 268 deletions src/Routes/data.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/Routes/schedule_vs_realtime_all_day_types_routes.json

Large diffs are not rendered by default.

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/stat-visuals/TripRatioGraph.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { React, useState, useEffect } from 'react';
import Plot from 'react-plotly.js';

import tripData from "../../Routes/schedule_vs_realtime_all_day_types_routes_2022-05-20_to_2023-07-02.json";
import tripData from "../../Routes/schedule_vs_realtime_all_day_types_routes.json";

function rollingAverage(values, windowSize) {
const result = [];
Expand Down