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 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?
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:
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 }}