# Specifying Github Environment for Deployments

**URL:** <https://community.fly.io/t/specifying-github-environment-for-deployments/28426>\
**Category:** Questions / Help\
**Created:** [August 5, 2026, 3:54am UTC](https://community.fly.io/t/specifying-github-environment-for-deployments/28426 "2026-08-05T03:54:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hdroguetta](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/hdroguetta/32/43884_2.png) [@hdroguetta](https://community.fly.io/u/hdroguetta)\
**Post date:** [August 5, 2026, 3:54am UTC](https://community.fly.io/t/specifying-github-environment-for-deployments/28426/1 "2026-08-05T03:54:38Z")

</div>

We’re leveraging the native UI deployment connection with Github, we have a production application `abc` and a staging application `abc-staging` to support production and staging deployments we leverage two different toml files so we can have both applications connected to the same repo. As part of the configuration in the [fly.io](http://fly.io) applications we specify which branch and toml file they should look for.

This is working well, but we have noticed that each deployment which occurs is placed under the ‘production’ environment in Github. We’d like to separate this out into the respective ‘staging’ and ‘production’ environments. Is there a configuration in the toml or elsewhere to accomplish this?

---

<div class="post-metadata">

**Author:** ![Sam-Fly](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/sam-fly/32/48731_2.png) [@Sam-Fly](https://community.fly.io/u/Sam-Fly)\
**Post date:** [August 6, 2026, 2:09am UTC](https://community.fly.io/t/specifying-github-environment-for-deployments/28426/2 "2026-08-06T02:09:48Z")

</div>

Hi @hdroguetta!

No, unfortunately it’s not currently possible to specify a specific GH environment on deploy . The UI deployer doesn’t pass a environment at all to Github, so GH just defaults to using `production`.

The simplest option if you wanted to configure different environments today would be to disable Deploy on Push using the UI deployer, and add a GH action workflow to run the deploy using the appropriate environment. A simplified example workflow would be:

```auto
   jobs:
     deploy-staging:
       runs-on: ubuntu-latest
       environment: staging
       steps:
         - uses: actions/checkout@v4
         - uses: superfly/flyctl-actions/setup-flyctl@master
         - run: flyctl deploy -c fly.staging.toml --remote-only
           env:
             FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [August 8, 2026, 2:10am UTC](https://community.fly.io/t/specifying-github-environment-for-deployments/28426/3 "2026-08-08T02:10:45Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
