R script workflow #364
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: R script workflow | |
on: | |
push: | |
schedule: | |
- cron: '0 13 * * 1-5' | |
jobs: | |
run_r_script: | |
runs-on: ubuntu-latest | |
container: | |
image: minhajuddin2510/rcode_files_update:latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install system dependencies for R packages | |
run: | | |
apt-get install -y libudunits2-dev libproj-dev | |
- name: Update CA certificates | |
run: update-ca-certificates | |
- name: Run R script | |
env: | |
GSHEET_SERVICE_ACCOUNT: ${{ secrets.GSHEET_SERVICE_ACCOUNT }} | |
uses: nick-fields/retry@v2 | |
with: | |
timeout_minutes: 30 | |
max_attempts: 3 | |
command: Rscript boerne-water-supply/rcode/main.R | |
- name: Configure Git to allow the repo directory | |
run: | | |
git config --global --add safe.directory /__w/boerne-dashboard/boerne-dashboard | |
- name: Commit and push if changes | |
run: | | |
git config --global user.email "action@github.com" | |
git config --global user.name "GitHub Action" | |
git add *.csv | |
git commit -m "Update data file" || echo "No changes to commit" | |
git push |