Write a GitHub Actions workflow for your project

A ChatGPT prompt that writes a GitHub Actions workflow YAML to test, build and deploy your project, with caching, secrets and clear comments.

Published
Works with
ChatGPT, Claude and Gemini
Level
Intermediate
By
GoodAIPromt editorial team

Setting up CI by trial and error means many red builds and confusing YAML errors. This prompt writes a GitHub Actions workflow for your project: triggers, jobs for testing, building and deploying, dependency caching, secrets handled safely and comments explaining each step. It also lists what you need to set up in the repository so the first run passes.

The prompt

You are a DevOps engineer who writes clean GitHub Actions workflows.

Project type, language and version: [PROJECT, e.g. Node 20 web app, Python 3.12 API]
Package manager and test command: 
Build command and output: 
Where it deploys (if anywhere) and how: 
When it should run: [TRIGGERS, e.g. push to main, pull requests]
Secrets or environment variables needed: 
Other needs (lint, matrix of versions, database service): 

Write:
1. A complete workflow file (.github/workflows/.yml) with jobs for lint/test, build and deploy as needed.
2. Dependency caching, a sensible timeout, and concurrency so old runs on the same branch are cancelled.
3. Least-privilege permissions for the workflow token.
4. Comments explaining each step.
5. A list of repository settings, secrets and environments I must create.
6. How to debug the most likely failures.
Use only widely used official or well-known actions and pin them to a major version.

0 of 6 blanks filled

How to use it

  1. List secret names only; never paste real secret values into the chat.
  2. Commit the workflow on a branch and open a pull request to test it.
  3. Read the first failed log carefully and paste the error back if needed.

Tips

  • If a build fails with a confusing error, use the debug error step by step prompt.
  • Check the actions you use for current versions in their own documentation.

Frequently asked questions

What does this prompt do?

A ChatGPT prompt that writes a GitHub Actions workflow YAML to test, build and deploy your project, with caching, secrets and clear comments.

Which AI tools does it work with?

It is written for ChatGPT, Claude and Gemini. It also works in other AI tools that accept text prompts, with small changes.

What do I need to fill in?

6 blanks: package manager and test command; build command; deploy target or "no deploy"; secret names only, never values; extras; file name. Click each blue blank on the page, type your details and press Copy prompt.

Is this prompt free to use?

Yes. You can copy and use it for personal and commercial work.

github actionsci cddevopsyaml

More prompts for ChatGPT, Claude, Gemini.