How to setup continuous deployment on Django application?

Published 19 May, 2022

Reading time: 2 Mins

Automate flyctl deploy procedure by setting up CI/CD on Github Actions.

Yesterday I posted about how to deploy your Django application into and make use of their free tier. Today I’m going to explain about how we can setup the continuous integration so that whenever developer push their code it will deploy automatically instead of the manual flyctl deploy steps.

I’m going to use Github Actions for this. Github actions is really easy for CI/CD. I only going to use deploy steps now.


  1. Create a personal access token. This access token is the window to your account. Later in our program you can pass --token in flyctl to deploy into production.
  2. Go to GitHub Settings and add your personal access token that you generated in the first steps to action secrets.

Setup Github Actions

To setup Github actions you have to create the .github/workflows folder in your project root folder. After you created the folder, create main.yml file.

Inside the file you can place this below content.

name: Fly Deploy

on: [push]


  FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}



      name: Deploy app

      runs-on: ubuntu-latest


        - uses: actions/checkout@v2

        - uses: superfly/flyctl-actions/setup-flyctl@master

        - run: flyctl deploy --remote-only --app gaclient

You can see that we can access the personal access token by calling ${{ secrets.FLY_ACCESS_TOKEN }} and this setup will run on each main branch pushes.

Check your logs in the if somethings is broken.

Read More