Hi mark. I had already generated the token before and it still didn’t work. I also tried to do it using the template you posted, but it gave my error. Detail that I’m trying to deploy in an organization, maybe I generated the token from my personal account. Or has nothing to do with it?
The detail about the org is interesting. I’d like to play with that too. I’ve been out sick and still recovering, so it may take some time before I can look into it.
@coraggio this error might be caused by a newline or whitespace in the secret stored in GitHub Actions. Can you make sure there’s no trailing whitespace and try again?
I just tested it out (I’ve been wanting to anyway) and verified I was able to auto-deploy the app on Fly when it belongs to a non-personal Fly.io organization.
So it should work for you! Please check what @michael recommended about he secret being multi-line and sensitive to spaces.
Hi mark. I tried Michael’s suggestion and now another error appears.
Do I need to set environment variables in fly.toml? When I manually deployed it, it found my project’s .env automatically. Now when trying to deploy from Github Actions, it is not finding.
Error: 2-10-19T11:34:32Z [info][ERROR] 11:34:32 EnvVarError: env-var: "DB_HOST" is a required variable, but it was not set
It sounds like spaces were the problem! Glad you got that fixed!
Yes, for the next problem, non-sensitive project ENV variables can be set in the fly.toml file. Use Fly secrets (also documented in the link) for Fly.io ENV that are sensitive.
The DB might be outside of Fly, it might be a Postgres one that Fly generated for you, it might be custom MySQL one.
When you create a Postgres DB on Fly, it automatically adds the secret for you. You can run fly secrets list to see what already exists. If the DB is “attached” to your app, the secrets are already available to your app.
I created a Postgres database on Fly, so I mean the URL they make available on the Fly dashboard for the bank.
I say the URL because I need to set the bank key in fly.toml through a URL, right? According to the documentation using flyctl secrets set DATABASE_URL=postgres://example.com/mydb.
So in Github Actions, my application could access the database to work. Detail that already attributes my Postgres bank to my application on Fly.
If I need to use my bank’s URL, I tried using the URL provided on the dashboard, but it didn’t work.