Covid Data -CI/ CD–part 5
Now I need that every data ( either from the github .md file, either gathered from https://github.com/CSSEGISandData/COVID-19/ ) be updated into the site.
Github Actions to the rescue!
I have created 2 different workflows : one for gathering the data from the https://systems.jhu.edu/research/public-health/ncov/ , the other for compiling the .md files and the Angular app. Thinking more, I should have had the Angular compiled into another workflow that was called after each one – but this is more AzureDevOps , than GitHub Actions.
1. Workflow for .md and for Angular
You can find the source at https://github.com/ignatandrei/WFH_Resources/blob/master/.github/workflows/blank.yml . It uses a Docker file to compile the Angular: https://github.com/ignatandrei/WFH_Resources/blob/master/makeData/compile.txt and a Docker batch to run the docker file and gather the results : https://github.com/ignatandrei/WFH_Resources/blob/master/makeData/compile.bat
Uses all the previous js and TypeScript files to transform and load data. Copies the data into the docs folder ( to be public available ) and then commits the data back to Github
It is run on both push at a cron job
on:
push:
pull_request:
schedule:
– cron: ‘5 4 * * *’
2. Workflow for gather last country data for Covid
You can find the source at https://github.com/ignatandrei/WFH_Resources/blob/master/.github/workflows/allnewdata.yml .It uses also a Docker file to compile data and run https://github.com/ignatandrei/WFH_Resources/blob/master/makeData/addNew.txt
And a docker compile file https://github.com/ignatandrei/WFH_Resources/blob/master/makeData/addNew.bat to gather the data from docker.
Also the workflow commits data to github. It is run at a cron job:
on:
schedule:
– cron: ‘5 2 * * *’