Avalanche Canada Forecasts #26452
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: Avalanche Canada Forecasts | |
on: | |
schedule: | |
- cron: '*/15 * * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Set up Conda environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: bier_env | |
python-version: 3.11 | |
- name: Install dependencies | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 3 | |
shell: bash | |
command: | | |
conda env update --file Avalanche-Canada-Forecasts/requirements.yaml --name bier_env | |
conda list -n bier_env | |
- name: Run script | |
shell: bash | |
env: | |
AGO_PORTAL_URL: ${{secrets.AGO_PORTAL_URL}} | |
AGO_USER: ${{secrets.AGO_USER}} | |
AGO_PASS: ${{secrets.AGO_PASS}} | |
AVALANCHEFORECAST_ITEMID: ${{secrets.AVALANCHEFORECAST_ITEMID}} | |
run: | | |
# you may have to activate the environment before running the | |
# python script, and you likley need to say python3 vs just python | |
conda init bash | |
. ~/.bashrc | |
conda activate bier_env | |
python3 Avalanche-Canada-Forecasts/Avalanche_Canada_Forecasts.py |