How To Set the Parent Full Deployment for Branch Deployments
Last updated: March 17, 2025
When using branch deployments, you can control which full deployment (e.g., prod or dev) serves as the parent full deployment, which determines which environment variables are inherited by your branch deployments.
Using the Single Workflow File Method
If you're using the single workflow file (dagster-plus-deploy.yml), you can specify the parent deployment directly in your workflow configuration:
In your dagster-plus-deploy.yml file, locate or add the deployment: parameter within the with: part of the step that performs ci-init .
Example from the dagster-cloud-serverless-quickstart:
# Parse dagster_cloud.yaml, detect if this is branch deployment and initialize the build session
- name: Initialize build session
id: ci-init
uses: dagster-io/dagster-cloud-action/actions/utils/ci-init@v0.1
with:
project_dir: ${{ env.DAGSTER_CLOUD_YAML_PATH }}
dagster_cloud_yaml_path: ${{ env.DAGSTER_CLOUD_FILE }}
# A full deployment name. If this run is for a pull request, this value will be used as
# the base deployment for the branch deployment.
deployment: 'prod'
Using Separate Workflow Files
If you're using separate workflow files (deploy.yml and branch_deployments.yml), then you'd need to add the deployment value to the with parameters of the serverless_prod_deploy and build_deploy_python_executable actions in each file.
Alternatively, the parent deployment can be set by the Dagster+ team. Note that this will apply for all branch deployments in all code locations.
When changing the parent deployment configuration, existing branch deployments will retain their association to the previous parent full deployment. Create a new branch deployment to use the new configuration.
Verifying Environment Variable Inheritance
You can verify the environment variable inheritance in your deployment settings. The Environment Variables section will show which variables are available to your branch deployment, inherited from the parent deployment.