Skip to content

Build secrets docs lie? #2026

@abaksha-sc

Description

@abaksha-sc

Link to the affected page or pages
(https://fly.io/docs/apps/build-secrets/

Describe what parts of the doc need improvement
You say "You can set secrets for your applications, but these are only available at run-time. They aren’t available when building your Docker image without a little extra work."

Ok. So I expect that I can use app secrets in build stage.
Then why in step 2 you say that some value should be provided? It's already in app secret (I just added it through UI in section "Secrets" of my application) and I expect that I can just use it with "a little extra work".

fly deploy \
    --build-secret MY_SUPER_SECRET=some_value

From this docs I don't understand how to use my application secrets in build stage.
I use GitHub actions like:

    steps:
      - uses: actions/checkout@v4
      - uses: superfly/flyctl-actions/setup-flyctl@master
      - run: flyctl deploy --remote-only -c fly.production.toml
        env:
          FLY_API_TOKEN: ${{ secrets.FLY_PROD_APP_TOKEN }}

So I need to duplicate secret in GitHub to pass its value to command flyctl deploy and can't just use it?
Like the following?

    steps:
      - uses: actions/checkout@v4
      - uses: superfly/flyctl-actions/setup-flyctl@master
      - run: flyctl deploy --remote-only -c fly.production.toml --build-secret MY_SUPER_SECRET=${{ secrets.FLY_PROD_APP_TOKEN }}
        env:
          FLY_API_TOKEN: ${{ secrets.FLY_PROD_APP_TOKEN }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions