Update Wastewater Data #68
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 Wastewater Data | |
on: | |
push: | |
branches: [main] | |
schedule: | |
- cron: '15 12 * * 5' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
fail-fast: false | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
RENV_PATHS_ROOT: ~/.local/share/renv | |
LANG: "en_US.UTF-8" | |
LC_ALL: "en_US.UTF-8" | |
USE_BSPM: "true" | |
_R_CHECK_FORCE_SUGGESTS_: "false" | |
steps: | |
- uses: actions/checkout@v3 | |
#- uses: quarto-dev/quarto-actions/install-quarto@v1 | |
#- run: | | |
# quarto --version | |
# - uses: r-lib/actions/setup-r@v2 | |
# id: install-r | |
# with: | |
# r-version: 4.1.3 | |
# Boostrap is from curl -OLs https://eddelbuettel.github.io/r-ci/run.sh | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip and install packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Bootstrap | |
run: | | |
chmod 0755 run.sh | |
./run.sh bootstrap | |
- name: Install system dependencies | |
if: runner.os == 'Linux' | |
env: | |
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc | |
GITHUB_PAT: ${{secrets.PAT}} | |
run: | | |
./run.sh install_all | |
# - name: Install dependencies | |
# run: | | |
# remotes::install_deps(dependencies = TRUE) | |
# remotes::install_cran("rcmdcheck") | |
# shell: Rscript {0} | |
# - name: Session info | |
# run: | | |
# options(width = 100) | |
# pkgs <- installed.packages()[, "Package"] | |
# sessioninfo::session_info(pkgs, include_base = TRUE) | |
# shell: Rscript {0} | |
- name: Setup just | |
uses: extractions/setup-just@v1 | |
- name: Run scraping | |
run: | | |
just all | |
just prep | |
# - name: Run script | |
# env: | |
# ACCESS_SECRET: ${{ secrets.ACCESS_SECRET }} | |
# ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
# CONSUMER_KEY: ${{ secrets.CONSUMER_KEY }} | |
# CONSUMER_SECRET: ${{ secrets.CONSUMER_SECRET }} | |
# run: |- | |
# quarto render | |
- name: Commit results | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Michael DeWitt" | |
git add . | |
git commit -m "Update the latest data" -a || echo "No changes to commit" | |
git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{ github.ref }} || echo "No changes to commit" |