.github/workflows/build.yaml #37
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
| on: | |
| schedule: | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| process: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - run: sudo apt-get update | |
| - run: sudo apt-get install -y libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev libudunits2-dev libproj-dev libgdal-dev libgeos-dev cmake libnode-dev | |
| - uses: actions/checkout@v4 | |
| with: | |
| ssh-key: ${{ secrets.DEPLOY_KEY }} | |
| fetch-depth: 0 | |
| - uses: r-lib/actions/setup-r@v2 | |
| - uses: r-lib/actions/setup-renv@v2 | |
| - run: Rscript -e "renv::install('dissc-yale/dcf')" | |
| - run: Rscript scripts/build.R | |
| - id: diff | |
| run: | | |
| if git diff --exit-code; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - if: ${{ steps.diff.outputs.changed == 'true' }} | |
| run: | | |
| git config user.email "actions@github.com" | |
| git config user.name "GitHub Actions" | |
| git add -A | |
| git commit -m "scheduled data build" | |
| git push |