cadc-2025-trigger-monitoring #110
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
# This workflow uses actions to automatically run the dry corridor drought trigger monitoring. | |
# script. | |
name: cadc-2025-trigger-monitoring | |
on: | |
workflow_dispatch: | |
inputs: | |
EMAIL_WHO: | |
required: true | |
type: choice | |
default: 'core_developer' | |
options: | |
- core_developer | |
- developers | |
- internal_chd | |
- internal_ocha | |
- full_list | |
WHEN_TO_MONITOR: | |
required: true | |
type: choice | |
default: 'last_primera' | |
options: | |
- last_primera | |
- last_postrera | |
- current | |
jobs: | |
monitor: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
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 }} | |
DS_AZ_BLOB_DEV_SAS: ${{ secrets.DS_AZ_BLOB_DEV_SAS }} | |
DS_AZ_DB_PROD_UID_WRITE: ${{ secrets.DS_AZ_DB_PROD_UID_WRITE }} | |
DS_AZ_DB_PROD_HOST: ${{ secrets.DS_AZ_DB_PROD_HOST }} | |
DS_AZ_DB_PROD_PW_WRITE: ${{ secrets.DS_AZ_DB_PROD_PW_WRITE }} | |
DS_AZ_DB_PROD_NAME: ${{ secrets.DS_AZ_DB_PROD_NAME }} | |
EMAIL_WHO: ${{ inputs.EMAIL_WHO || 'core_developer' }} | |
WHEN_TO_MONITOR: ${{ inputs.WHEN_TO_MONITOR || 'current' }} | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: ${{ secrets.DS_AZ_DB_PROD_UID_WRITE }} | |
POSTGRES_PASSWORD: ${{ secrets.DS_AZ_DB_PROD_PW_WRITE }} | |
POSTGRES_DB: ${{ secrets.DS_AZ_DB_PROD_NAME }} | |
POSTGRES_HOST: localhost | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a healthcheck | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
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 \ | |
libfreetype6-dev \ | |
libcurl4-openssl-dev | |
- name: Cache R dependencies | |
id: cache-r-deps | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: R-dependency-cache-${{ hashFiles('.github/depends_2025.R') }} | |
- name: Install R dependencies | |
if: steps.cache-r-deps.outputs.cache-hit != 'true' | |
run: | | |
Rscript -e 'install.packages("remotes")' | |
Rscript .github/depends_2025.R | |
- name: Run R-script-test-env-vars | |
shell: bash | |
run: Rscript ./src/monitoring_2025/test_gha_settings.R | |
# - name: Run R-script-cadc-2025-trigger-monitoring | |
# shell: bash | |
# run: Rscript ./src/monitoring_2025/update_activation_status.R |