Skip to content

Update monthly delays chart #26

Update monthly delays chart

Update monthly delays chart #26

name: Update monthly delays chart
on:
schedule:
- cron: '0 0 1 * *'
workflow_dispatch:
jobs:
update_monthly_delays_chart:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pandas scipy numpy pyarrow requests
- name: Run Python script
run: |
cd code
python get_filtered_weekends_vacation_covid_delays.py
- name: Commit filtered weekends vacation covid delays
run: |
git pull
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add -u data/output/filtered_weekends_vacation_covid_delays.feather
if git diff --cached --quiet; then
echo "No changes to commit."
else
git commit -m 'Update filtered weekends vacation covid delays'
git push
fi
- name: Next job
if: steps.compare_files.outputs.files_are_same == 'true'
run: |
echo "Files are the same, moving to the next job."
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Install R dependencies
run: |
sudo apt-get install -y libxml2-dev libcurl4-openssl-dev libssl-dev
sudo apt-get install -y default-jdk
sudo apt-get install pandoc
sudo apt-get install -y r-cran-rcpp r-cran-rcpptoml r-cran-dplyr r-cran-readr r-cran-lubridate r-cran-reticulate r-cran-tidyr r-cran-htmlwidgets
R_LIB_PATH=$(Rscript -e 'cat(.libPaths()[1])')
echo "R_LIBS_USER=$R_LIB_PATH:/usr/lib/R/site-library:/usr/local/lib/R/site-library" >> $GITHUB_ENV
# sudo Rscript -e "install.packages(c('dplyr', 'readr', 'lubridate', 'reticulate', 'tidyr', 'highcharter', 'htmlwidgets', 'pandoc'), lib='$R_LIB_PATH', repos='https://cloud.r-project.org/')"
sudo Rscript -e "install.packages(c('highcharter'), lib='$R_LIB_PATH', repos='https://cloud.r-project.org/')"
- name: Run get_num_monthly_delays R script
run: |
cd code
Rscript get_num_monthly_delays.r
- name: Run get_avg_monthly_delay_time R script
run: |
cd code
Rscript get_avg_monthly_delay_time.r
- name: Commit num monthly delays
run: |
git pull
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git pull
git add -u visuals/
if git diff --cached --quiet; then
echo "No changes to commit."
else
git commit -m "Update num monthly delays charts"
git push
fi