Skip to content

cadc-trigger-monitoring #59

cadc-trigger-monitoring

cadc-trigger-monitoring #59

# This workflow uses actions to automatically run the dry corridor drought trigger monitoring.
# script.
name: cadc-trigger-monitoring
on:
workflow_dispatch:
inputs:
TEST_EMAIL:
required: true
type: choice
default: "TRUE"
options:
- "TRUE"
- "FALSE"
jobs:
monitor:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.x'
- uses: r-lib/actions/setup-pandoc@v2
- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libxml2-dev \
libgdal-dev \
libproj-dev \
libgeos-dev \
libudunits2-dev \
libsodium-dev
- name: Create authorization JSON
id: create-json
uses: jsdaniell/[email protected]
with:
name: "sa_auth.json"
json: ${{ secrets.GCP_CREDENTIALS }}
- name: Cache R dependencies
id: cache-r-deps
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: R-dependency-cache-${{ hashFiles('.github/depends.R') }}
- name: Install R dependencies
if: steps.cache-r-deps.outputs.cache-hit != 'true'
run: |
Rscript .github/depends.R
- name: Cache additional R dependencies
id: cache-r-deps-additional
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: R-dependency-cache-${{ hashFiles('.github/depends_additional.R') }}
- name: Install additonal R dependencies
if: steps.cache-r-deps-additional.outputs.cache-hit != 'true'
run: |
Rscript .github/depends_additional.R
- name: Run cadc-trigger-monitoring
run: |
source(file.path("src", "02_monitor_forecast.R"))
shell: Rscript {0}
env:
CADC_MONITORING_JSON: "sa_auth.json"
CHD_DS_EMAIL_USERNAME: ${{ secrets.CHD_DS_EMAIL_USERNAME }}
CHD_DS_EMAIL_PASSWORD: ${{ secrets.CHD_DS_EMAIL_PASSWORD }}
CHD_DS_HOST: ${{ secrets.CHD_DS_HOST }}
CHD_DS_PORT: ${{ secrets.CHD_DS_PORT }}
ECMWF_USER_UID: ${{ secrets.ECMWF_USER_UID }}
ECMWF_USER_KEY: ${{ secrets.ECMWF_USER_KEY }}
DSCI_AZ_ENDPOINT: ${{ secrets.DSCI_AZ_ENDPOINT }}
DSCI_AZ_SAS_DEV: ${{ secrets.DSCI_AZ_SAS_DEV}}
TEST_EMAIL: ${{ inputs.TEST_EMAIL || 'FALSE' }}