Generate Git action CI/CD pipeline using Amazon Q CLI

This is a submission for the Amazon Q Developer "Quack The Code" Challenge: Crushing the Command Line GitHub Actions is a popular CI/CD platform used to build, test, and deploy your code directly from GitHub. It allows you to automate workflows such as code reviews, running test cases, building applications, and deploying them. In this tutorial, we will learn how to use Amazon Q to create GitHub Actions workflows for your application. Amazon Q CLI is a generative AI-powered software development assistant. It understands the context of your code and provides an interactive way to ask questions and make changes to your code. Amazon Q CLI includes commands like q chat and q translate, which let you ask questions about your codebase and convert natural language instructions into shell commands. Let's see how you can interact with Amazon Q CLI to generate GitHub Actions workflows for a CI/CD pipeline using natural language. Amazon Q supports multi-turn conversations, so you can refine the GitHub Actions file or provide custom instructions through a dialogue-based interface. This tutorial assumes that you have configured Amazon Q CLI on your local machine. If not, please follow below link. Getting started with Amazon Q Developer CLI Ricardo Sueiras for AWS ・ Apr 2 #genai #aws We will refer to this project in our tutorial. shivamarora1 / sakai-react Free React Admin Template This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev # or pnpm dev # or bun dev Open http://localhost:3000 with your browser to see the result. Learn More To learn more about Next.js, take a look at the following resources: Next.js Documentation - learn about Next.js features and API. Learn Next.js - an interactive Next.js tutorial. View on GitHub Our first objective is to add a GitHub Actions CI workflow to the project. Open your terminal and paste below command. q chat "Add Github action workflow to this project that will whenever code is pushed to any branch. This workflow is for CI. It checks the formatting, linting and checks whether project is building or not." When you give this instruction, Amazon Q CLI will take some time to process. It will analyze the entire project to understand the structure. Then, it will prompt you to create a .github/workflows folder and a ci.yaml file with all the given instructions. Let's push the code and test this workflow. Cool! We successfully created our first workflow using the Amazon Q AI software assistant. Next step is to write workflow for building and deploying our project. Since this is static website we can deploy our workflow to public S3 bucket. q chat "Add github action workflow to deploy this project amazon s3 bucket" Within few seconds it generated code for building and deploying application to S3 bucket. Since *Amazon Q CLI * is multi turn conversational assistant , It has also generated instructions to create a bucket in Amazon with public access ACL policy. This is pretty helpful documentation for configuring deployment environment. Unlike other AI assistants, it won't leave you midway—it will also guide you on the next steps to take. In our case, the next steps are to create AWS access keys and secrets, and configure them in the GitHub repository. Code Repository shivamarora1 / sakai-react Free React Admin Template This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev # or pnpm dev # or bun dev Open http://localhost:3000 with your browser to see the result. Learn More To learn more about Next.js, take a look at the following resources: Next.js Documentation - learn about Next.js features and API. Learn Next.js - an interactive Next.js tutorial. View on GitHub Conclusion CLI based AI assistant is really cool for developers. As a developers we spent alot of times on CLI. We work with a lot of open source tools it become tough to remember commands to run them. In such cases CLI based AI assistant is really helpful.

May 11, 2025 - 18:24
 0
Generate Git action CI/CD pipeline using Amazon Q CLI

This is a submission for the Amazon Q Developer "Quack The Code" Challenge: Crushing the Command Line

GitHub Actions is a popular CI/CD platform used to build, test, and deploy your code directly from GitHub. It allows you to automate workflows such as code reviews, running test cases, building applications, and deploying them.

In this tutorial, we will learn how to use Amazon Q to create GitHub Actions workflows for your application.

Amazon Q CLI is a generative AI-powered software development assistant. It understands the context of your code and provides an interactive way to ask questions and make changes to your code. Amazon Q CLI includes commands like q chat and q translate, which let you ask questions about your codebase and convert natural language instructions into shell commands.

Let's see how you can interact with Amazon Q CLI to generate GitHub Actions workflows for a CI/CD pipeline using natural language. Amazon Q supports multi-turn conversations, so you can refine the GitHub Actions file or provide custom instructions through a dialogue-based interface.

This tutorial assumes that you have configured Amazon Q CLI on your local machine. If not, please follow below link.

We will refer to this project in our tutorial.

GitHub logo shivamarora1 / sakai-react

Free React Admin Template

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

Learn More

To learn more about Next.js, take a look at the following resources:




Our first objective is to add a GitHub Actions CI workflow to the project. Open your terminal and paste below command.

q chat "Add Github action workflow to this project that will whenever code is pushed to any branch. This workflow is for CI. It checks the formatting, linting and checks whether project is building or not."

Image description

When you give this instruction, Amazon Q CLI will take some time to process. It will analyze the entire project to understand the structure. Then, it will prompt you to create a .github/workflows folder and a ci.yaml file with all the given instructions.

Image description

Let's push the code and test this workflow.

Image description

Cool! We successfully created our first workflow using the Amazon Q AI software assistant.

Next step is to write workflow for building and deploying our project. Since this is static website we can deploy our workflow to public S3 bucket.

q chat "Add github action workflow to deploy this project amazon s3 bucket"

Within few seconds it generated code for building and deploying application to S3 bucket.

Image description

Since *Amazon Q CLI * is multi turn conversational assistant , It has also generated instructions to create a bucket in Amazon with public access ACL policy. This is pretty helpful documentation for configuring deployment environment.

Image description

Unlike other AI assistants, it won't leave you midway—it will also guide you on the next steps to take. In our case, the next steps are to create AWS access keys and secrets, and configure them in the GitHub repository.

Image description

Code Repository

GitHub logo shivamarora1 / sakai-react

Free React Admin Template

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

Learn More

To learn more about Next.js, take a look at the following resources:






Conclusion

CLI based AI assistant is really cool for developers. As a developers we spent alot of times on CLI. We work with a lot of open source tools it become tough to remember commands to run them. In such cases CLI based AI assistant is really helpful.