Translation Not Available
This page is not yet available in German. Showing English content instead.
Help us translate this page! Contribute on GitHub
GitHub Actions Integration#
Run bdp pull in CI to ensure every pipeline run, test, and deployment uses the exact same data declared in bdp.lock. Cache the downloaded files between runs to avoid redundant downloads.
Basic Workflow#
name: Analysis
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install BDP
run: curl -sSfL https://get.bdp.sh | sh
- name: Pull data
run: bdp pull
env:
BDP_SERVER_URL: ${{ secrets.BDP_SERVER_URL }}
- name: Run analysis
run: python scripts/analysis.pyCaching Between Runs#
BDP downloads can be large. Use actions/cache keyed on bdp.lock — the cache is invalidated automatically whenever your locked versions change:
name: Analysis
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install BDP
run: curl -sSfL https://get.bdp.sh | sh
- name: Cache BDP data
uses: actions/cache@v4
with:
path: .bdp/data
key: bdp-${{ hashFiles('bdp.lock') }}
restore-keys: |
bdp-
- name: Pull data
run: bdp pull
env:
BDP_SERVER_URL: ${{ secrets.BDP_SERVER_URL }}
- name: Run analysis
run: python scripts/analysis.pyWhen bdp.lock hasn't changed, bdp pull finds all files already cached and skips downloading — the job runs immediately.
Snakemake Pipeline#
name: Pipeline
on: [push]
jobs:
snakemake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: pip install snakemake
- name: Install BDP
run: curl -sSfL https://get.bdp.sh | sh
- name: Cache BDP data
uses: actions/cache@v4
with:
path: .bdp/data
key: bdp-${{ hashFiles('bdp.lock') }}
- name: Pull data
run: bdp pull
env:
BDP_SERVER_URL: ${{ secrets.BDP_SERVER_URL }}
- name: Generate Snakemake config
run: bdp generate snakemake > bdp_config.yaml
- name: Run pipeline
run: snakemake --cores allEnvironment Variables in CI#
All BDP_* source path variables are available to subsequent steps after bdp pull runs. Set them explicitly if your analysis script needs them outside of hooks:
- name: Pull data
run: |
bdp pull
# Export BDP paths for subsequent steps
echo "BDP_UNIPROT_P01308_FASTA=$BDP_UNIPROT_P01308_FASTA" >> $GITHUB_ENV
env:
BDP_SERVER_URL: ${{ secrets.BDP_SERVER_URL }}Secrets#
Set your BDP server URL as a repository secret:
- Go to Settings → Secrets and variables → Actions
- Add
BDP_SERVER_URLwith your server address
If you are using the public BDP registry, no secret is needed.
GitLab CI#
The same pattern works for GitLab CI:
analysis:
image: ubuntu:22.04
cache:
key:
files:
- bdp.lock
paths:
- .bdp/data/
script:
- curl -sSfL https://get.bdp.sh | sh
- bdp pull
- python scripts/analysis.py
variables:
BDP_SERVER_URL: $BDP_SERVER_URLFull Example#
See the complete GitHub Actions examples on Codeberg — includes analysis.yml (Python variant analysis) and snakemake-pipeline.yml (Snakemake with bcftools + bedtools).