get-NRZ-data #761
This file contains hidden or 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: "get-NRZ-data" | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 8,16 * * 1,5" | |
| jobs: | |
| get-NRZ-data: | |
| runs-on: macos-13 | |
| steps: | |
| - uses: actions/checkout@main | |
| - name: Setup R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: 4.1.2 | |
| - name: Install XQuartz for imager | |
| run: brew install xquartz --cask | |
| - name: Cache R packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.R_LIBS_USER }} | |
| key: r-${{ hashFiles('DESCRIPTION') }} | |
| - name: Get weekly NRZ data | |
| run: | | |
| cd ./code | |
| Rscript ./get_nrz_data.R | |
| - name: Commit files | |
| env: | |
| AUTH: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git remote rm origin | |
| git remote add origin https://${AUTH}@github.com/KITmetricslab/RESPINOW-Data.git > /dev/null 2>&1 | |
| git pull origin main | |
| git add --all | |
| git commit --allow-empty -m "Weekly NRZ update" | |
| - name: Push changes | |
| run: | | |
| git push --quiet --set-upstream origin HEAD:main | |
| echo "pushed to github" |