Skip to main content
AIPromptIndex
GitHub Copilot Coding advanced

GitHub Actions Workflow Builder

Added Apr 2, 2026

Generate a complete GitHub Actions CI/CD workflow for the following project requirements. Project type and tech stack: [PROJECT_STACK] Workflow triggers and branching strategy: [WORKFLOW_TRIGGERS] Build and test requirements: [BUILD_TEST_REQUIREMENTS] Deployment target and strategy: [DEPLOYMENT_TARGET] Create a production-ready GitHub Actions workflow that includes: 1. Proper workflow triggers using on: push, pull_request, and workflow_dispatch with appropriate branch filters and path filters to avoid unnecessary runs 2. A CI job that checks out code, sets up the runtime environment with caching for dependencies (npm, pip, etc.), runs linting, type checking, and unit tests in parallel where possible 3. A build job that creates production artifacts, runs integration tests, and generates any necessary build outputs 4. A deployment job with proper environment protection rules, approval gates for production, and rollback instructions 5. Matrix strategy for testing across multiple OS or runtime versions if applicable 6. Proper secret management using GitHub Secrets and environment-specific variables, never hardcoding sensitive values 7. Concurrency controls to cancel redundant workflow runs on the same branch 8. Status checks and branch protection rule recommendations to enforce CI passing before merging 9. Reusable workflow patterns using composite actions or called workflows for shared logic 10. Notification steps that report build status to Slack, Discord, or email on failure 11. Caching strategy for Docker layers, dependency managers, and build outputs to minimize CI time 12. Comments explaining each step so the team can maintain the workflow going forward
0
Share
Try in GitHub Copilot

About This Prompt

This prompt generates complete, production-grade GitHub Actions CI/CD workflows with proper caching, matrix testing, deployment gates, and notification setup. It goes beyond basic build-and-test by implementing real-world requirements like concurrency controls, environment-specific secrets, branch protection recommendations, and rollback procedures. The output is a drop-in YAML file with comprehensive comments that make the workflow maintainable by the entire team. It is ideal for development teams setting up CI/CD for new projects, migrating from other CI systems like Jenkins or CircleCI, or optimizing slow existing workflows with better caching and parallelization strategies.

Variables to Customize

[PROJECT_STACK]

Your project's technology stack and package manager

Example: Next.js 15 with TypeScript, pnpm, Prisma ORM, PostgreSQL, deployed as Docker container

[WORKFLOW_TRIGGERS]

When the workflow should run and your branching strategy

Example: Run CI on all PRs to main. Deploy to staging on merge to main. Deploy to production on release tags (v*). Manual trigger for hotfixes.

[BUILD_TEST_REQUIREMENTS]

What needs to happen during CI and build

Example: ESLint + Prettier check, TypeScript compilation, Jest unit tests (95% coverage threshold), Playwright E2E tests against a test database, Docker image build

[DEPLOYMENT_TARGET]

Where and how the application deploys

Example: AWS ECS Fargate with ECR for Docker images. Staging auto-deploys, production requires manual approval. Use AWS OIDC for credentials, no long-lived access keys.

Tips for Best Results

  • Include your current CI run time and target so the optimization suggestions are calibrated appropriately
  • Mention any monorepo or workspace setup since this affects path filtering and job dependencies
  • Specify if you use any infrastructure-as-code tools like Terraform since they often need their own workflow jobs

Example Output

```yaml
name: CI/CD Pipeline

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  release:
    types: [published]
  workflow_dispatch:
    inputs:
      environment:
        description: 'Deploy target'
        required: true
        type: choice
        options: [staging, production]

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
  lint-and-typecheck:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v3
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: 'pnpm'
      # Lint and type check run in parallel...
```
github-actions ci-cd devops automation deployment

Get the Best AI Prompts Weekly

Curated prompts, tips, and guides delivered to your inbox every week. Free.