https://dagster.io/ logo
#ask-community
Title
# ask-community
s

Sebastian Charrier

06/15/2023, 10:08 AM
Please help... How do I get the branch deployment id (value between cloud/ and /runs)
<https://xxxxxxxx.dagster.cloud/57d2700a51ded0b52fa0a3475b78c31614bb8d54/runs>
Using github actions, or the dagster-cloud CLI or graphql The idea is to run a job to create a preprod environment on a branch deployment. I have follow this guide https://docs.dagster.io/guides/dagster/branch_deployments and I have achieved run the job every time I create a pull request. The only part missing is that the job is running in production, but instead I would like to run the job from the Branch deployment. This is part of my github action
Copy code
- name: Build and deploy
        id: deploy
        if: env.ENABLE_FAST_DEPLOYS == 'true'
        uses: dagster-io/dagster-cloud-action/actions/build_deploy_python_executable@pex-v0.1
        with:
          dagster_cloud_file: "$GITHUB_WORKSPACE/project-repo/dagster_cloud.yaml"
          build_output_dir: "$GITHUB_WORKSPACE/build"
          python_version: "3.10"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          

      - name: Clone Snowflake
        if: github.event.action != 'closed'
        uses: dagster-io/dagster-cloud-action/actions/utils/run@v0.1
        with:
          location_name: data_analytics
          deployment: ${{ steps.deploy.outputs.deployment }}
          job_name: create_preprod
        env:
          DAGSTER_CLOUD_URL: "<http://xxxxxx.dagster.cloud>"
          DAGSTER_CLOUD_API_TOKEN: ${{ secrets.DAGSTER_CLOUD_API_TOKEN }}
How can I retrieve the branch deployment id from "Build and deploy" and pass it to the deployment variable in "Clone Snowflake" step. this value
${{ steps.deploy.outputs.deployment }}
is coming empty the graphql for the branch deployment is in the format https://xxxxxxxx.dagster.cloud/9b864fc769056eb155f240a1f5fc77c2b6b1701b/graphql so this is the id I am looking for 9b864fc769056eb155f240a1f5fc77c2b6b1701b I tried to use this action, but looks like it is not working
dagster-io/dagster-cloud-action/actions/utils/get_branch_deployment@v0.1
Thank you!!
🤖 1
d

daniel

06/15/2023, 6:22 PM
I see this conversation is continuing here: https://dagster.slack.com/archives/C02LJ7G0LAZ/p1686811684924829?thread_ts=1686807282.008969&amp;cid=C02LJ7G0LAZ - will keep an eye on that thread