technologiestiftung / giessdenkiez-de

The consequences of climate change, especially the dry and hot summers, are putting a strain on Berlin's ecosystem. Our urban trees are drying out and suffering long-term damage. Gieß den Kiez is made to enable coordinated citizen participation in the irrigation of urban trees.
https://www.giessdenkiez.de
MIT License
84 stars 31 forks source link

feat: manual trigger for DWD #910

Closed Jaszkowic closed 4 months ago

vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
giessdenkiez-de ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 0:07am
ff6347 commented 4 months ago

Could we merge these two actions to be one? (Made GPT4 merge them looks right but should be tested)

name: DWD Radolan Harvester Unified

on:
  workflow_dispatch:
    inputs:
      environment:
        description: "Environment (e.g. development or production)"
        required: true
        type: string
      dwd_harvester_version:
        description: "Version of the DWD Harvester Docker Image"
        required: true
        type: string
  repository_dispatch:
    types: [radolan_cron]

jobs:
  rain:
    runs-on: ubuntu-latest
    name: Aggregate rain data from DWD radolan
    steps:
      - name: Set Up Variables
        run: |
          echo "ENVIRONMENT=${{ github.event.inputs.environment || github.event.client_payload.environment || 'development' }}" >> $GITHUB_ENV
          echo "DWD_VERSION=${{ github.event.inputs.dwd_harvester_version || github.event.client_payload.dwd_harvester_version || 'latest' }}" >> $GITHUB_ENV
        id: setup-variables
      - name: Harvester
        uses: "technologiestiftung/giessdenkiez-de-dwd-harvester@${{ env.DWD_VERSION }}"
        id: harvester
        env:
          environment: ${{ env.ENVIRONMENT }}
        with:
          PG_SERVER: ${{ secrets.PG_SERVER }}
          PG_PORT: ${{ secrets.PG_PORT }}
          PG_USER: ${{ secrets.PG_USER }}
          PG_PASS: ${{ secrets.PG_PASS }}
          PG_DB: ${{ secrets.PG_DB }}
          SUPABASE_URL: ${{ vars.SUPABASE_URL }}
          SUPABASE_BUCKET_NAME: ${{ vars.SUPABASE_DATA_ASSETS_BUCKET }}
          SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
          OUTPUT: "True"
          LOGGING: "INFO"
          MAPBOXUSERNAME: ${{ secrets.MAPBOXUSERNAME }}
          MAPBOXTOKEN: ${{ secrets.MAPBOXTOKEN }}
          MAPBOXTILESET: ${{ secrets.MAPBOXTILESET }}
          MAPBOXLAYERNAME: ${{ secrets.MAPBOXLAYERNAME }}
          SKIP_MAPBOX: "False"
          LIMIT_DAYS: ${{ vars.LIMIT_DAYS }}
          SURROUNDING_SHAPE_FILE: ${{ vars.SURROUNDING_SHAPE_FILE }}
Jaszkowic commented 4 months ago

@ff6347 thought about this as well. I will try it out in a test repository, super hard to test here (needs merge to main branch first to be able to trigger repository_dispatch)

ff6347 commented 4 months ago

https://github.com/technologiestiftung/dispatch_actions_poc/blob/main/.github/workflows/test.yml