Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the github action instructions, so that it doesn't show a spec… #1071

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
1. Fork the [go-example](https://github.com/fly-apps/go-example) repository to your GitHub account.
2. Clone the new repository to your local machine.
3. Run `fly launch` from within the project source directory to create a new app and a `fly.toml` configuration file. Type `N` when `fly launch` asks if you want to set up databases and `N` when it asks if you want to deploy.
4. Still in the project source directory, get a Fly API deploy token by running `fly tokens create deploy -x 999999h`. Copy the output.
4. Still in the project source directory, get a Fly API deploy token by running `fly tokens create deploy -x “custom access token”`. The access token can be generated at https://fly.io/user/personal_access_tokens. Copy the output.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
4. Still in the project source directory, get a Fly API deploy token by running `fly tokens create deploy -x “custom access token`. The access token can be generated at https://fly.io/user/personal_access_tokens. Copy the output.
4. Still in the project source directory, get a Fly API deploy token by running `fly tokens create deploy -x <your-access-token>`. The access token can be generated at https://fly.io/user/personal_access_tokens. Copy the output.

Our convention is to put angle brackets around "variables" in CLI examples.

This suggestion is based on the assumption that you don't actually need double quotes around the token string -- if you do, we need to add the double quotes back in.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I thought 9999999h was the lifetime of the token, i.e. "expire in that many hours".

But it's still not clear to me why run fly tokens create deploy -x “custom access token” with the custom token at all? For me, the deployment worked entirely without running that command, I just generated the token at the dashboard and inserted it directly into GH repo secrets. What is the purpose of this command?

Copy link
Contributor

@andie787 andie787 Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @anatoliykmetyuk
You're right that the value of -x is the token expiry!

Sorry, talked about this internally with @Lucais11 yesterday, but we didn't get back to this PR yet to note what we talked about.

(Per the discussion over in #1065, we weren't sure if you got the error when you ran the fly tokens create deploy command or when you tried to use the token you got from that command. Since the error happened when you tried to use the token, then we'll have to look into what happened there.)

The short version is that you solved your issue by using a different kind of token.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized I didn't answer all your questions. Just to clarify, you would not run fly tokens create deploy -x “custom access token”, that was a misunderstanding.
The command fly tokens create deploy creates a deploy token. A deploy token is scoped to the app you created it for, while the token you created in the UI under Account is a user-scoped OAuth token.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we weren't sure if you got the error when you ran the fly tokens create deploy command or when you tried to use the token you got from that command. Since the error happened when you tried to use the token, then we'll have to look into what happened there.) The short version is that you solved your issue by using a different kind of token

Yes, to clarify, fly tokens create deploy worked just fine, but the token it produced did not work when I was actually deploying from GH Actions.

5. Go to your newly-created repository on GitHub and select **Settings**.
6. Under **Secrets and variables**, select **Actions**, and then create a new repository secret called `FLY_API_TOKEN` with the value of the token from step 4.
7. Back in your project source directory, create `.github/workflows/fly.yml` with these contents:
Expand Down Expand Up @@ -87,7 +87,7 @@

**Step 7** is the heart of the process, where you put in place a workflow. Now, GitHub has a UI which allows you to select and edit workflows, but you can also modify them as part of the repository. So you create `.github/workflows/fly.yml` - you'll likely want to `mkdir -p .github/workflows` to quickly create the directories - and load up the file with a GitHub Action recipe.

Github Action recipe, line by line:

Check notice on line 90 in app-guides/continuous-deployment-with-github-actions.html.md

View workflow job for this annotation

GitHub Actions / vale

[vale] app-guides/continuous-deployment-with-github-actions.html.md#L90

[Fly.Spelling] Is 'Github' a typo?
Raw output
{"message": "[Fly.Spelling] Is 'Github' a typo?", "location": {"path": "app-guides/continuous-deployment-with-github-actions.html.md", "range": {"start": {"line": 90, "column": 1}}}, "severity": "INFO"}

```yaml
name: Fly Deploy
Expand Down
Loading