Skip to content

Commit

Permalink
Add a section explaining how to deploy using github actions (#592)
Browse files Browse the repository at this point in the history
* Add a section explaining how to deploy using github actions

* Reword things

* Update danger section

* Remove preferred word
  • Loading branch information
kumaranvpl authored Nov 20, 2024
1 parent 35e708b commit 6ea92d4
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,31 @@ Similarly, running the Docker container is as simple as running the provided scr

### Deploying to Fly.io

If you created the project using Cookiecutter, there is a built-in script to deploy your workflow to [**Fly.io**](https://fly.io/). Run it as shown below:
If you created the project using Cookiecutter, there are built-in scripts to deploy your workflow to [**Fly.io**](https://fly.io/). In Fly.io, the application namespace is global, so the application name you chose might already be taken. To check your application's name availability and to reserve it, you can run the following script:

```console
./scripts/register_to_fly_io.sh
```

Once you have reserved your application name, you can test whether you can deploy your application to Fly.io using the following script:

```console
./scripts/deploy_to_fly_io.sh
```

This is only for testing purposes. You should deploy using [**GitHub Actions**](https://github.com/features/actions){target="_blank"} as explained below.

Cookiecutter generated all the necessary files to deploy your application to Fly.io using [**GitHub Actions**](https://github.com/features/actions). Simply push your code to your github repository's **main** branch and GitHub Actions will automatically deploy your application to Fly.io. For this, you need to set the following secrets in your GitHub repository:

- `FLY_API_TOKEN`
- `OPENAI_API_KEY`

To learn how to create keys and add them as secrets, use the following links:

- [**Creating a Fly.io API token**](https://fly.io/docs/security/tokens/#manage-tokens-in-the-dashboard)
- [**Creating an OpenAI API key**](https://platform.openai.com/api-keys)
- [**Adding secrets to your GitHub repository**](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository)

## Future Plans

We are actively working on expanding FastAgency’s capabilities. In addition to supporting AutoGen, we plan to integrate support for other frameworks, other network provider and other UI frameworks.
Expand Down
39 changes: 38 additions & 1 deletion docs/docs/en/user-guide/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,9 @@ After logging in, the script will check if the application name is available and
```
</details>

Once you have reserved your application name, you can deploy your application to Fly.io using the following script:
#### Deploying to Fly.io manually

Once you have reserved your application name, you can test whether you can deploy your application to Fly.io using the following script:

```console
./scripts/deploy_to_fly_io.sh
Expand Down Expand Up @@ -483,3 +485,38 @@ This script will deploy your application to Fly.io without any further input. Th
Checking DNS configuration for write-fastagency-docs-delicate-waterfall-7272.fly.dev
```
</details>


This is only for testing purposes. You should deploy using [**GitHub Actions**](https://github.com/features/actions){target="_blank"} as explained in the next section.

#### Deploying to Fly.io using GitHub Actions

Cookiecutter generated all the necessary files to deploy your application to Fly.io using [**GitHub Actions**](https://github.com/features/actions){target="_blank"}. Github Actions deployment worfkow will not work unless you follow these steps:

1. Create a [**new GitHub repository**](https://github.com/new){target="_blank"} with your FastAgency project name.

2. Add the following secrets to your GitHub repository:

- `FLY_API_TOKEN`: Your Fly.io API token.
- `OPENAI_API_KEY`: Your OpenAI API key.

To learn how to create keys and add them as secrets, use the following links:

- [**Creating a Fly.io API token**](https://fly.io/docs/security/tokens/#manage-tokens-in-the-dashboard){target="_blank"}
- [**Creating an OpenAI API key**](https://platform.openai.com/api-keys){target="_blank"}
- [**Adding secrets to your GitHub repository**](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository){target="_blank"}

3. In your devcontainer's terminal, run the following commands to commit and push your project to the new GitHub repository:

```console
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/<username>/<repo-name>.git
git branch -M main
git push -u origin main
```

Make sure to replace `<username>` and `<repo-name>` with your GitHub username and repository name, respectively.

Once these steps are complete, the GitHub Actions workflow will automatically deploy your application to Fly.io. And continue to do so every time you push changes to your repository's **main** branch.

0 comments on commit 6ea92d4

Please sign in to comment.