Hello, we have a project running on fly which was deployed from local development now we are moving to using Github action but we are having issue with loading environment variable which was added to Github secrets.
When are deploying from local development all of our environmental variables are added to fly.toml in env section.
Currently, the deployment from Github action is failing because it cant get the secret from Github
name: Fly Deploy
on: [push]
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
FUSION_AUTH_API_KEY: ${{ secrets.FUSION_AUTH_API_KEY }}
FUSION_AUTH_APP_ID: ${{ secrets.FUSION_AUTH_APP_ID }}
FUSION_AUTH_PUBLIC_KEY: ${{ secrets.FUSION_AUTH_PUBLIC_KEY }}
FUSION_AUTH_URL: ${{ secrets.FUSION_AUTH_URL }}
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: echo "FUSION_AUTH_URL $FUSION_AUTH_URL"
- run: echo "FLY_API_TOKEN $FLY_API_TOKEN"
- run: flyctl deploy
--build-secret FUSION_AUTH_URL=$FUSION_AUTH_URL
--remote-only
Am getting an error that it can’t find the variable.
What is the best way to add multiple (up to 20) environment variables to fly env?
@kurt Is it possible to load the variable in fly.toml file ?