Update cases #18129
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update cases | |
on: | |
schedule: | |
# GitHub Actions uses UTC. This time is converted from MYT to UTC. | |
- cron: "0 */12 * * *" | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: szenius/[email protected] | |
with: | |
timezoneLinux: "Asia/Kuala_Lumpur" | |
- name: Check if jq is installed - if not then install | |
run: sudo apt-get install jq | |
- name: Check if imagemagick for images is installed - if not then install | |
run: sudo apt-get install imagemagick | |
- name: Update national data | |
run: | | |
cd $GITHUB_WORKSPACE | |
chmod +x update.sh | |
sh update.sh | |
- name: Commit national data (HTML) to GitHub | |
run: | | |
echo Pushing to GitHub... | |
git config --global user.email "[email protected]" | |
git config --global user.name "weareblahs/covidcases auto update bot" | |
dateandtime=$( date +"%d %b %Y %H:%M:%S GMT+8" ) | |
git add . | |
git commit -m "Update national cases and deaths ($dateandtime)" | |
git push | |
- name: Update state data | |
run: | | |
cd $GITHUB_WORKSPACE | |
chmod +x updatestate.sh | |
sh updatestate.sh | |
- name: Commit state data (HTML) to GitHub | |
run: | | |
echo Pushing to GitHub... | |
git config --global user.email "[email protected]" | |
git config --global user.name "weareblahs/covidcases auto update bot" | |
dateandtime=$( date +"%d %b %Y %H:%M:%S GMT+8" ) | |
git add . | |
git commit -m "Update state cases ($dateandtime)" | |
git push |