Skip to content

Commit

Permalink
Add a section explaining how to deploy using github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaranvpl committed Nov 20, 2024
1 parent 35e708b commit c3bed51
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,23 @@ 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
```

Follow it by running the following script to deploy your application to Fly.io:

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

Or, you can push your code to github, where [**GitHub Actions**](https://github.com/features/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`

## 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
32 changes: 32 additions & 0 deletions docs/docs/en/user-guide/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ After logging in, the script will check if the application name is available and
```
</details>

#### Deploying to Fly.io manually

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

```console
Expand Down Expand Up @@ -483,3 +485,33 @@ 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>

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

If you prefer to deploy your application to Fly.io using GitHub Actions, you can do so by following these steps:

1. Create a [**new GitHub repository**](https://github.com/new) 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)
- [**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)

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
```

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.

0 comments on commit c3bed51

Please sign in to comment.