Update Update Data Files.yml #21
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] | |
jobs: | |
run_r_script: | |
runs-on: ubuntu-latest | |
container: | |
image: minhajuddin2510/rcode_files_update:latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
ref: test | |
- name: Ensure workspace directory exists | |
run: | | |
mkdir -p /github/workspace/ | |
- name: Decode Google Sheets token | |
env: | |
GSHEET_TOKEN: ${{ secrets.GSHEET_TOKEN }} | |
run: | | |
echo "$GSHEET_TOKEN" | base64 -d > /github/workspace/gargle-oauth | |
- name: Install system dependencies for R packages | |
run: | | |
sudo apt-get install -y libudunits2-dev | |
- name: Run R script | |
run: Rscript boerne-water-supply/rcode/use1_demand_data.R | |
- name: Commit and push if changes | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add *.csv | |
git commit -m "Update data file" || echo "No changes to commit" | |
git push |