Skip to content
Latchkey

How to Pull DVC-Tracked Data in GitHub Actions

dvc pull restores the exact data and model files pinned by the .dvc metadata committed to Git, using a configured remote and secret credentials.

Install DVC, configure the remote credentials from a secret, then run dvc pull to materialize the data version referenced by the current commit before training or testing.

Steps

  • Install DVC with the remote extra (e.g. dvc[s3]).
  • Set remote credentials from repository secrets.
  • Run dvc pull to fetch the pinned data.

Workflow

.github/workflows/ci.yml
jobs:
  data:
    runs-on: ubuntu-latest
    env:
      AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
      AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
    steps:
      - uses: actions/checkout@v4
      - run: pip install "dvc[s3]"
      - run: dvc pull -j 4

Gotchas

  • Commit the .dvc files and dvc.lock so CI pulls the exact version you tested locally.
  • Use -j to parallelize the pull for many small files.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →