- Create a new folder for your project and go into it with
cd <folder name>
- Make it a git repository with
git init
- Copy .github, .dockerignore, .gitignore to this new folder.
- Create a new NodeJS project with
npm init
- Edit
package.json
to add a start script, such as"start": "node server.js"
- Install Express.js with
npm i express
- Copy the example server from
server.js
over to this folder - Install flyctl with
iwr https://fly.io/install.ps1 -useb | iex
- Create a fly account with
flyctl auth signup
-
Sign up with GitHub
-
Authorize Fly.io
- Input your credit card details, needed even if you dont use more than the free tier.
- You should see
successfully logged in as EMAIL
in the terminal - Run
flyctl launch
- Enter a name for your app, choose a region. Choose no to a Postgresql database and to deploy now
- Create a repository on GitHub
- Enable GitHub actions in the Actions tab
- Go to Settings>Secrets>Actions and create a new secret
- Name the secret FLY_API_TOKEN and run
flyctl auth token
and paste the result as the value - Follow the
…or push an existing repository from the command line
steps