.github/workflows/archive_new_wells_csv.yaml #1083
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
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- .github/workflows/archive_new_wells_csv.yaml | |
- R/archive_new_wells_csv.R | |
schedule: | |
- cron: "0 6 * * *" | |
jobs: | |
job1: | |
runs-on: ubuntu-latest | |
container: | |
image: lespelleteux/docker_for_gwells | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_PAT }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
BCGOV_GEOCODER_API: ${{ secrets.BCGOV_GEOCODER_API }} | |
BCGOV_DB: ${{ secrets.BCGOV_DB }} | |
BCGOV_HOST: ${{ secrets.BCGOV_HOST }} | |
BCGOV_PWD: ${{ secrets.BCGOV_PWD }} | |
BCGOV_USR: ${{ secrets.BCGOV_USR }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: list files | |
run: | | |
ls * -lh | |
- name: list files data | |
run: | | |
ls data/* | |
- name: archive new wells | |
run: | | |
Rscript R/archive_new_wells_csv.R | |
- name: list files | |
run: | | |
ls * -lh | |
- name: list files data | |
run: | | |
ls data/* | |
- name: Commit results | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git status | |
git add 'data/wells.csv' || echo "ECHO No changes to commit" | |
git add 'data/drilling_method.csv' || echo "ECHO No changes to commit" | |
git commit -m "automatic update" || echo "ECHO No changes to commit" | |
git push origin || echo "ECHO No changes to commit" | |
git status | |
- name: Session info | |
run: | | |
options(width = 100) | |
pkgs <- installed.packages()[, "Package"] | |
sessioninfo::session_info(pkgs, include_base = TRUE) | |
shell: Rscript {0} |