Skip to content
Merged
10 changes: 10 additions & 0 deletions .github/workflows/run-manage-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ on:
description: 'Custom manage.py command — if provided, overrides the dropdown above (e.g. dbshell, shell_plus --print-sql)'
required: false
type: string
workflow_call:
inputs:
environment:
description: 'Environment to run against'
required: true
type: string
command:
description: 'Non-interactive manage.py command to run (e.g. log_global_state_metrics, authflow_id_delete)'
required: true
type: string

env:
AWS_REGION: us-east-1
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/scheduled-django-commands.yml
Comment thread
annamontare-nava marked this conversation as resolved.
Comment thread
annamontare-nava marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Scheduled Django Manage Commands

on:
schedule:
- cron: "0 3 * * *"
timezone: "America/New_York"
- cron: "0 18 * * *"
timezone: "America/New_York"
workflow_dispatch:
inputs:
environment_level:
description: 'Environment(s) to run against'
required: true
type: choice
options:
- lower
- higher

jobs:
scheduled-lower-environment:
Comment thread
annamontare-nava marked this conversation as resolved.
uses: ./.github/workflows/run-manage-command.yml
if: ${{ inputs.environment_level == 'lower' || github.event.schedule == '0 18 * * *' }}
with:
environment: test
command: log_global_state_metrics
secrets: inherit
scheduled-higher-environments:
uses: ./.github/workflows/run-manage-command.yml
if: ${{ inputs.environment_level == 'higher' || github.event.schedule == '0 3 * * *' }}
strategy:
Comment thread
annamontare-nava marked this conversation as resolved.
fail-fast: false
matrix:
environment:
- sandbox
- prod
command:
- log_global_state_metrics
- authflow_id_delete
with:
environment: ${{ matrix.environment }}
command: ${{ matrix.command }}
secrets: inherit
Loading