Deploy to Fly.io automatically with Tangled pipelines
fly.md edited
29 lines 1.5 kB view raw view rendered
1# Deploy to Fly.io automatically with Tangled pipelines 2Deploying to Fly.io via a Tangled pipeline is incredibly easy. 3 4## Step 1: get started with Fly.io (optional) 5The first step is launching your Fly app. I'll defer to the Fly.io docs for this: [Quickstart: Launch your app](https://fly.io/docs/getting-started/launch/) 6 7## Step 2: create a deploy token 8On the [dashboard](https://fly.io/dashboard), select the application you just created. On the sidebar, select "Tokens". Create a new one called "Tangled" or something else that fits your needs. Once you've done that, go back to your Tangled repository and go to the "Settings" page and and select the "pipelines" tab. In the "Secrets" section, click "add secret". The name of the secret will be `FLY_API_TOKEN` and the content will be the deploy token you just made. Save it, and you're good to go! 9 10## Step 3: add the workflow 11Now that you've technically authenticated with Fly, put the following workflow file in your repository, and you're ready to deploy! Just commit this and head back over to Tangled. On the "pipelines" page you'll see your pipeline running! It's genuinely that simple. Once it's done you can visit your application on Fly.io and make sure everything looks good. 12 13*.tangled/workflows/deploy.yml* 14```yaml 15when: 16 - event: ["push", "manual"] 17 branch: ["main"] 18 19engine: "nixery" 20 21dependencies: 22 nixpkgs: 23 - flyctl 24 25steps: 26 - name: deploy 27 command: | 28 fly deploy --remote-only --ha=false 29```