Skip to content

prod__run-dagster

prod__run-dagster #13

name: prod__run-dagster
on:
schedule:
- cron: '0 5 * * 3,6'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
UV_LOCK_FILE: "**/transformations/uv.lock"
UV_CACHE_DIR: "/home/runner/.cache/uv"
jobs:
run-dagster:
runs-on: ubuntu-latest
environment: prod
defaults:
run:
working-directory: transformations
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv with version pinned
id: setup-uv
uses: astral-sh/setup-uv@v3
with:
version: "0.5.x"
enable-cache: true
cache-dependency-glob: ${{ env.UV_LOCK_FILE }}
- name: Cache uv installs
uses: actions/cache@v4
id: uv-cache
with:
path: ${{ env.UV_CACHE_DIR }}
key: ${{ runner.os }}-uv-${{ hashFiles(env.UV_LOCK_FILE) }}
restore-keys: |
${{ runner.os }}-uv-
- name: Install python and dependencies via uv
if: steps.uv-cache.outputs.cache-hit != 'true'
run: |
mkdir -p $UV_CACHE_DIR
uv python install 3.11
uv sync
echo "Cache directory after uv sync:"
ls -R $UV_CACHE_DIR
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Authenticate gh CLI
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
- name: Download Dagster artifact from previous run
run: gh run download --name dagster-prod-state --dir dagster
- name: Run Dagster pipeline
run: task dagster:run
env:
CLI_ARGS: "-f dagster_catboost.py"
MOTHERDUCK_TOKEN: ${{ secrets.MOTHERDUCK_TOKEN }}
POSTGRES_URL: ${{ secrets.POSTGRES_URL }}
APP_ENV: ${{ vars.APP_ENV }}
- name: Upload updated Dagster artifact
uses: actions/upload-artifact@v4
with:
name: dagster-prod-state
path: |
transformations/dagster/**
!transformations/dagster/dagster.yaml
retention-days: 90
overwrite: true