Skip to main content

A simple wizard for generating GitHub Actions workflows for common tasks.

Project description

GitHub Actions Wizard

GitHub Actions Wizard is a simple tool for generating GitHub Actions workflows for common deployment tasks.

Built primarily for my needs, but you're free to use it, if you find it useful.

It goes beyond simple workflow generation by automatically setting up necessary permissions (such as creating AWS IAM Roles and Policies for S3 or Lambda deployments). The intent is to quickly generate the overall workflow boilerplate, and then customize by editing the generated file.

To use it, run the github-actions-wizard CLI tool in your repository's folder, and answer the interactive prompts. The generated workflow file will be saved in your repository's .github/workflows folder. You can customize the file further, as necessary.

Installation

You can install GitHub Actions Wizard via pip:

pip install github-actions-wizard

This will install the command-line tool as github-actions-wizard.

Usage

Run the wizard from the root of your Git repository:

github-actions-wizard

You'll be guided through a series of prompts to select the deployment target, branch, and other details. The tool will then generate the appropriate workflow YAML file and, for AWS deployments, set up the required IAM roles and policies.


Features

  • Easy workflow generation for deployments
  • Automatic AWS permissions setup for S3 and Lambda deployments
  • Supports multiple deployment targets for setting up pipelines like build -> test -> [deploy0, deploy1, ...]
  • Interactive CLI guides you through configuration
  • Edit generated workflows to fine-tune for your project

Why?

While you can certainly write these workflow files yourself, this tool reduces the friction of setting up deployments each time a new GitHub repository is created. The deployment setup is more than just the workflow yaml file (for e.g. AWS targets need IAM Role and Policy creation).

I needed this for myself because I release a lot of projects. The deployment targets vary per project - some copy files to AWS S3, others publish to PyPI, some release on itch.io, others deploy to AWS Lambda, and so on. It's a waste of time to look up and configure CI/CD manually each time I release a new project.


Workflow Templates

  • Python package - build and publish to PyPI
  • npm package - build and publish to npm
  • Static Hugo website - build and deploy to GitHub Pages
  • Static S3 website - build and deploy to AWS S3
  • Static Cloudflare Pages website - build and deploy to Cloudflare Pages
  • AWS Lambda - build and deploy to AWS Lambda
  • itch.io - build and publish to itch.io
  • Pytest CI - run tests with pytest on push and pull request (test-only)
  • Custom workflow

Custom Workflows

Deployment targets:

  • AWS S3 (static site or zip-and-upload)
  • AWS Lambda (function deployment)
  • Publish to PyPI
  • Publish to npm
  • GitHub Pages
  • Cloudflare Pages
  • Publish to itch.io
  • Add build artifacts to GitHub release

Build types:

  • Python wheel (.whl) and tar.gz package
  • Static site with Hugo
  • Dummy build

Examples

1. Deploy to AWS S3

$ github-actions-wizard

Select a workflow template to start with:
1. Python package - build and publish to PyPI
2. npm package - build and publish to npm
3. Static website - build and deploy to GitHub Pages
4. Static website - build and deploy to AWS S3
5. Static website - build and deploy to Cloudflare Pages
6. AWS Lambda - deploy a Python function to AWS Lambda
7. itch.io - build and publish to itch.io
8. Pytest CI - run tests with pytest on push and pull request (test-only)
9. Custom workflow
Enter option number: 4

Select deployment trigger:
1. On branch push
2. On release creation
Enter option number: 1

Enter branch name (will react to pushes on this branch) [default=main]:
Enter GitHub repo [default=cmdr2/carbon]:
Enter AWS S3 path to deploy to (e.g., my-bucket-name/some/path (or path/to/file.zip)): me.cmdr2.org/carbon

Configuring S3 deploy permissions in IAM...

⚠️ **IMPORTANT:** Please ensure that you set the S3_DEPLOY_ROLE environment variable (in your GitHub repository) to <generated-arn>

✅ Workflow update complete. Workflow written: .github/workflows/gha_workflow.yml. Please customize it as necessary.

After this, pushes to the main branch of this repo will automatically upload to AWS S3.

2. Deploy to AWS Lambda

$ github-actions-wizard

Select a workflow template to start with:
1. Python package - build and publish to PyPI
2. npm package - build and publish to npm
3. Static website - build and deploy to GitHub Pages
4. Static website - build and deploy to AWS S3
5. Static website - build and deploy to Cloudflare Pages
6. AWS Lambda - deploy a Python function to AWS Lambda
7. itch.io - build and publish to itch.io
8. Pytest CI - run tests with pytest on push and pull request (test-only)
9. Custom workflow
Enter option number: 6

Select deployment trigger:
1. On branch push
2. On release creation
Enter option number: 1

Enter branch name (will react to pushes on this branch) [default=main]:
Enter GitHub repo [default=cmdr2/blog-agent]:
Enter the AWS Lambda function name to deploy to (e.g., my-function): blog-agent

Configuring Lambda deploy permissions in IAM...

⚠️ **IMPORTANT:** Please ensure that you set the LAMBDA_DEPLOY_ROLE environment variable (in your GitHub repository) to <generated-arn>

✅ Workflow update complete. Workflow written: .github/workflows/gha_workflow.yml. Please customize it as necessary.

After this, pushes to the main branch of this repo will automatically update the AWS Lambda Function.

3. Deploy to PyPI

$ github-actions-wizard

Select a workflow template to start with:
1. Python package - build and publish to PyPI
2. npm package - build and publish to npm
3. Static website - build and deploy to GitHub Pages
4. Static website - build and deploy to AWS S3
5. Static website - build and deploy to Cloudflare Pages
6. AWS Lambda - deploy a Python function to AWS Lambda
7. itch.io - build and publish to itch.io
8. Pytest CI - run tests with pytest on push and pull request (test-only)
9. Custom workflow
Enter option number: 1

Select deployment trigger:
1. On branch push
2. On release creation
Enter option number: 2

⚠️ **IMPORTANT:** Please ensure that you've added GitHub as a trusted publisher in your PyPI account: https://docs.pypi.org/trusted-publishers/
Note: You can use the workflow file name (gha_workflow.yml) while configuring the trusted publisher.

✅ Workflow update complete. Workflow written: .github/workflows/gha_workflow.yml. Please customize it as necessary.

Customization

After generation, you can edit the workflow YAML file in .github/workflows to add project-specific steps or modify the configuration as needed.

FAQ

Please see this page for frequently asked questions.


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github_actions_wizard-1.9.2.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

github_actions_wizard-1.9.2-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file github_actions_wizard-1.9.2.tar.gz.

File metadata

  • Download URL: github_actions_wizard-1.9.2.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for github_actions_wizard-1.9.2.tar.gz
Algorithm Hash digest
SHA256 f4c1aea3269f9fb0a1dcbe28febba36fc535796a8d0e2fb2cbc6715d277dcf18
MD5 2b55f3d7722aab2f061471f010524f11
BLAKE2b-256 03a63d83a70aa100e6a3cb10643cdd0453c9890726af014f73ecc3a06ea2ae02

See more details on using hashes here.

Provenance

The following attestation bundles were made for github_actions_wizard-1.9.2.tar.gz:

Publisher: ci_deploy_workflow.yml on cmdr2/github-actions-wizard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file github_actions_wizard-1.9.2-py3-none-any.whl.

File metadata

File hashes

Hashes for github_actions_wizard-1.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7c2c3911975a8fa859418a789cb54f4c68b0504fb12ab7a967c73c552a957414
MD5 f65fc2c16eeb1a258ac7e3a8ac7e20f1
BLAKE2b-256 a06360144c8a0af1b3bb1ae481587f5e6dc66f9c3d14074d7a6a38e0047d366e

See more details on using hashes here.

Provenance

The following attestation bundles were made for github_actions_wizard-1.9.2-py3-none-any.whl:

Publisher: ci_deploy_workflow.yml on cmdr2/github-actions-wizard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page