You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -81,14 +81,28 @@ Prior to your first deployment, you'll need to do a few things:
81
81
fly auth signup
82
82
```
83
83
84
+
> **Note:** If you have more than one Fly account, ensure that you are signed into the same account in the Fly CLI as you are in the browser. In your terminal, run `fly auth whoami` and ensure the email matches the Fly account signed into the browser.
85
+
84
86
- Create two apps on Fly, one for staging and one for production:
85
87
86
88
```sh
87
-
fly create blog-tutorial-ffb5
88
-
fly create blog-tutorial-ffb5-staging
89
+
fly apps create blog-tutorial-ffb5
90
+
fly apps create blog-tutorial-ffb5-staging
89
91
```
90
92
91
-
- Create a new [GitHub Repository](https://repo.new)
93
+
> **Note:** Make sure this name matches the `app` set in your `fly.toml` file. Otherwise, you will not be able to deploy.
94
+
95
+
- Initialize Git.
96
+
97
+
```sh
98
+
git init
99
+
```
100
+
101
+
- Create a new [GitHub Repository](https://repo.new), and then add it as the remote for your project. **Do not push your app yet!**
102
+
103
+
```sh
104
+
git remote add origin <ORIGIN_URL>
105
+
```
92
106
93
107
- Add a `FLY_API_TOKEN` to your GitHub repo. To do this, go to your user settings on Fly and create a new [token](https://web.fly.io/user/personal_access_tokens/new), then add it to [your repo secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) with the name `FLY_API_TOKEN`.
94
108
@@ -99,7 +113,7 @@ Prior to your first deployment, you'll need to do a few things:
99
113
fly secrets set SESSION_SECRET=$(openssl rand -hex 32) --app blog-tutorial-ffb5-staging
100
114
```
101
115
102
-
If you don't have openssl installed, you can also use [1password](https://1password.com/password-generator) to generate a random secret, just replace `$(openssl rand -hex 32)` with the generated secret.
116
+
If you don't have openssl installed, you can also use [1Password](https://1password.com/password-generator) to generate a random secret, just replace `$(openssl rand -hex 32)` with the generated secret.
103
117
104
118
- Create a persistent volume for the sqlite database for both your staging and production environments. Run the following:
105
119
@@ -108,7 +122,15 @@ Prior to your first deployment, you'll need to do a few things:
108
122
fly volumes create data --size 1 --app blog-tutorial-ffb5-staging
109
123
```
110
124
111
-
Now that everything is set up, you can commit and push your changes to your repo. Every commit to your `main` branch will trigger a deployment to your production environment, and every commit to your `dev` branch will trigger a deployment to your staging environment.
125
+
Now that everything is set up you can commit and push your changes to your repo. Every commit to your `main` branch will trigger a deployment to your production environment, and every commit to your `dev` branch will trigger a deployment to your staging environment.
126
+
127
+
### Connecting to your database
128
+
129
+
The sqlite database lives at `/data/sqlite.db` in your deployed application. You can connect to the live database by running `fly ssh console -C database-cli`.
130
+
131
+
### Getting Help with Deployment
132
+
133
+
If you run into any issues deploying to Fly, make sure you've followed all of the steps above and if you have, then post as many details about your deployment (including your app name) to [the Fly support community](https://community.fly.io). They're normally pretty responsive over there and hopefully can help resolve any of your deployment issues and questions.
0 commit comments