<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Emamuzo Omokiti</title>
    <description>The latest articles on DEV Community by Emamuzo Omokiti (@emamuzo).</description>
    <link>https://dev.to/emamuzo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1045999%2F7554c450-e6d1-4b95-bc24-ada91eb896ca.jpeg</url>
      <title>DEV Community: Emamuzo Omokiti</title>
      <link>https://dev.to/emamuzo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/emamuzo"/>
    <language>en</language>
    <item>
      <title>The Ultimate Guide to Deploying on Fly.io with GitHub Actions</title>
      <dc:creator>Emamuzo Omokiti</dc:creator>
      <pubDate>Thu, 08 Jun 2023 14:24:21 +0000</pubDate>
      <link>https://dev.to/emamuzo/the-ultimate-guide-to-deploying-on-flyio-with-github-actions-4ike</link>
      <guid>https://dev.to/emamuzo/the-ultimate-guide-to-deploying-on-flyio-with-github-actions-4ike</guid>
      <description>&lt;p&gt;I came across &lt;a href="https://fly.io/"&gt;Fly.io&lt;/a&gt;. when I was looking for another platform to deploy my applications other than the ones I already knew.&lt;/p&gt;

&lt;p&gt;Fly.io is a platform that help's you deploy your application just like Netlify, Vercel, etc. It doesn't matter what framework you are using, Fly.io got you covered 😉.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to Deploy on Fly.io with GitHub
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1
&lt;/h3&gt;

&lt;p&gt;Sign up on Fly.io&lt;/p&gt;

&lt;p&gt;Go to &lt;a href="https://fly.io/"&gt;Fly.io&lt;/a&gt; and click on the &lt;strong&gt;Sign Up&lt;/strong&gt; button&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5ZFHvEzG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686054585016/43c6ca0a-3ac9-40f5-9e6c-6b942301270f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5ZFHvEzG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686054585016/43c6ca0a-3ac9-40f5-9e6c-6b942301270f.png" alt="The Fly Sign Up button" width="800" height="65"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2
&lt;/h3&gt;

&lt;p&gt;Sign up using your GitHub account or Email&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EKwgn573--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686055350023/d67d533d-1a4b-4236-b0e4-92bad0669440.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EKwgn573--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686055350023/d67d533d-1a4b-4236-b0e4-92bad0669440.png" alt="Fly Sign up Page" width="800" height="543"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I will sign up and sign in using my GitHub account.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3
&lt;/h3&gt;

&lt;p&gt;You will be routed to your dashboard. Click on &lt;strong&gt;Billing&lt;/strong&gt; to add a credit card. All plans on Fly.io need a credit card.&lt;/p&gt;

&lt;p&gt;According to Fly.io&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We don't offer a "free tier." Instead, we offer some free resource allowances that apply to all plans, including the Hobby plan, and includes enough usage per month to run a small full-stack app, full-time, for free.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3jfDHIdO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686138383990/ac3749e7-8349-4654-b9ad-a0667a9496c6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3jfDHIdO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686138383990/ac3749e7-8349-4654-b9ad-a0667a9496c6.png" alt="Fly dashboard billing tab" width="318" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4
&lt;/h3&gt;

&lt;p&gt;Install flyctl&lt;/p&gt;

&lt;p&gt;flyctl is a command line utility that helps you work with Fly.io in your terminal.&lt;/p&gt;

&lt;p&gt;Install based on your operating system. I will install flyctl using brew&lt;/p&gt;

&lt;p&gt;MacOS&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;flyctl

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Linux&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; https://fly.io/install.sh | sh

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Windows&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pwsh &lt;span class="nt"&gt;-Command&lt;/span&gt; &lt;span class="s2"&gt;"iwr https://fly.io/install.ps1 -useb | iex"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5
&lt;/h3&gt;

&lt;p&gt;Since you have installed flyctl on your terminal, you will have access to fly.io commands. Run the following command in the root directory of your app&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fly launch

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--orQhOSOg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686136427752/5e077140-85b2-4099-b213-b4f9311955e2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--orQhOSOg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686136427752/5e077140-85b2-4099-b213-b4f9311955e2.png" alt="Image of Terminal" width="581" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you run the command above, you will be asked a series of questions such as;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Choose an app name (leave blank to generate one): You can give your app a name or leave it blank so Fly.io will generate one for you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose a region for deployment: some regions are not free. You can check out more about regions on the Fly.io Docs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Would you like to deploy now? : You will select No because we want to sync our app with GitHub&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 6
&lt;/h3&gt;

&lt;p&gt;Get a Fly.io token by running the command below. Copy the output and paste it somewhere because you will need it later.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; fly tokens create deploy &lt;span class="nt"&gt;-x&lt;/span&gt; 999999h

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 7
&lt;/h3&gt;

&lt;p&gt;Go to the GitHub Repository of the app you want to deploy and Click on &lt;strong&gt;Settings&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QMCFKau---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686059272060/cf87194f-207e-4773-ad27-6e725969ede5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QMCFKau---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686059272060/cf87194f-207e-4773-ad27-6e725969ede5.png" alt="Settings tab of author repository" width="800" height="74"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 8
&lt;/h3&gt;

&lt;p&gt;You will be routed to the settings page, scroll down to the &lt;strong&gt;Security section&lt;/strong&gt; and click on &lt;strong&gt;Secrets and variables&lt;/strong&gt; and select &lt;strong&gt;Actions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rOXmqTPR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686059831215/4a2948b6-ce12-435a-8931-fac8d295ab8b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rOXmqTPR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686059831215/4a2948b6-ce12-435a-8931-fac8d295ab8b.png" alt="Security section of the author repository" width="800" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 9
&lt;/h3&gt;

&lt;p&gt;You will be routed to the secrets page click on the &lt;strong&gt;New repository secret&lt;/strong&gt; button&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gqYFVgvq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686059978586/f0b8c6b0-5a3b-4eb7-8e42-f889136a6013.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gqYFVgvq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686059978586/f0b8c6b0-5a3b-4eb7-8e42-f889136a6013.png" alt="secrets page" width="800" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 10
&lt;/h3&gt;

&lt;p&gt;Give your action secret a name. I will name mine &lt;strong&gt;FLY_API_TOKEN.&lt;/strong&gt; In the secret field, paste the token you got in &lt;strong&gt;Step 5&lt;/strong&gt; and click &lt;strong&gt;on the Add secret button.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tZ1MPm1---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686060030304/18cfc0d2-097e-4c1d-8fc3-42cad76c30a6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tZ1MPm1---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686060030304/18cfc0d2-097e-4c1d-8fc3-42cad76c30a6.png" alt="Action Secret Page" width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 11
&lt;/h3&gt;

&lt;p&gt;Go back to your IDE(Integrated Development Environment) and do the following ;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;In the root of your app directory create a folder and name it. &lt;strong&gt;github&lt;/strong&gt; If you don't have one like me.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Inside the &lt;strong&gt;.github&lt;/strong&gt; folder create another folder and name it &lt;strong&gt;workflows&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the workflows folder create a file and name it &lt;strong&gt;fly.yml&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Paste the code below inside the &lt;strong&gt;fly.yml&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: Fly Deploy
on:
  push:
    branches:
      - main
jobs:
  deploy:
    name: Deploy app
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: superfly/flyctl-actions/setup-flyctl@master
      - run: flyctl deploy --remote-only
        env:
          FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 12
&lt;/h3&gt;

&lt;p&gt;Commit your changes and push them to GitHub. Click on the &lt;strong&gt;Actions&lt;/strong&gt; tab of your repository to see the deployment in progress.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rpeUhSZo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686069986198/307e6f05-ebb3-4406-9148-ea6c5d724600.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rpeUhSZo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686069986198/307e6f05-ebb3-4406-9148-ea6c5d724600.png" alt="Actions page" width="800" height="282"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 13
&lt;/h3&gt;

&lt;p&gt;If you go to your Fly.io dashboard you will see your deployed app&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KU4NqIRO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686071250695/9c128095-9c06-4a92-93cd-847f2d1396c6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KU4NqIRO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686071250695/9c128095-9c06-4a92-93cd-847f2d1396c6.png" alt="Fly Dashboard" width="800" height="129"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on your app name to see details of your app&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 14
&lt;/h3&gt;

&lt;p&gt;Click on the &lt;strong&gt;Hostname&lt;/strong&gt; you would be able to access your app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ce8aqnU4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686071303847/d9690cc6-ac2d-4363-bce2-454aa9b0b229.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ce8aqnU4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1686071303847/d9690cc6-ac2d-4363-bce2-454aa9b0b229.png" alt="Author app details" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;From &lt;strong&gt;Step 5&lt;/strong&gt; you can deploy your app when asked &lt;strong&gt;Would you like to deploy now?&lt;/strong&gt; If you had selected yes, your app would have been deployed but when you make changes to your application, you will have to repeat &lt;strong&gt;the fly launch process&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You went through this route so that when you make changes to your app and push it to GitHub, It would automatically be deployed and you don't have to repeat &lt;strong&gt;the fly launch&lt;/strong&gt;  &lt;strong&gt;process&lt;/strong&gt; when you make changes to your app.&lt;/p&gt;

&lt;p&gt;Let me know what you think about Fly.io.&lt;/p&gt;

&lt;p&gt;Happy Coding!!!&lt;/p&gt;

</description>
      <category>flyio</category>
      <category>githubactions</category>
      <category>shecodeafrica</category>
    </item>
  </channel>
</rss>
