So I want to deploy my ruby on rails application after all the test passes to fly.io, so I followed the instructions in this document but it doesn’t seem to work.
Here’s the error received by github-actions:
> Run flyctl deploy --remote-only
Error No access token available. Please login with 'flyctl auth login'
Error: Process completed with exit code 1.
I just ran through the instructions successfully with a new Rails application, and was able to deploy:
I made some minor formatting and clarifications to that page. The secret needs to be a Repository secret, and the current recommendation is to set the environment variable only on the deploy step.
Double check that you didn’t make any copy/paste errors or typos perhaps?
Ok, so I mistakenly added FLY_API_TOKEN secret to an ‘Environments secret’ instead of adding it to the ‘Repository secret’ and that’s the reason why it couldn’t access the secret as it was looking in the ‘Repository secret’, hence the error, No access token available.
I had a similar issue. The solution I found was by adding the name of your environment that contains the secret. Example using the environment name production below: