Skip to content

A collection of GitHub Actions that can be used to automate the testing, building, and deployment of custom GitHub Actions using workflows

License

Notifications You must be signed in to change notification settings

stingaa/action-builder

Repository files navigation

Tools for building GitHub Actions

This repository contains actions that can be used to automate the testing, building, and deployment of custom GitHub Actions using workflows.

Workflows

Makefile

Adding automatic deployments to your Actions - Multi-Action

  1. Download the appropriate tar file from the releases page and copy it into your repository.
  2. Untar the copied file, creating a new set of Makefiles and configuration files in your repository.
  3. Copy action_template.mk into the sub-folder of each of your actions, and rename it to Makefile.
  4. For each of your actions, update the new Makefile to:
    1. Use the include directives for any of the helper files that make sense for your Action.
    2. Set the target depedencies for each of the default targets that make sense for your Action.
    3. Add any additional actions that you would like performed to the target definitions.
    4. If you leave everything for the target blank, it will be skipped, but don't delete it or you will get errors.
  5. Optionally: update your Makefile to represent the Docker image name that you would like. If none is specified the directory name will be used by default.
    1. Add IMAGE_NAME=<action_name> to each Action's Makefile. Replace <action_name with the name of the image to publish.

Actions

These have similar functionality to a number of top level actions. The key differences are that they aggregate some functionality, and include make.

GitHub Action for Shell

Tools for linting and testing shell scripts, as well as linting dockerfiles, using makefiles and dockerfile_lint.

Usage

An example workflow to run Dockerfile linting and with Google Cloud Platform and run the gcloud command:

workflow "Lint and Test Source" {
  on = "push"
  resolves = ["Test"]
}
 action "Lint" {
  uses = "actions/action-builder/shell@master"
  runs = "make"
  args = "lint"
}
 action "Test" {
  needs = "Lint"
  uses = "actions/action-builder/shell@master"
  runs = "make"
  args = "test"
}
 action "Build" {
  needs = ["Test", "Lint"]
  uses = "actions/action-builder/docker@master"
  runs = "make"
  args = "build"
}

GitHub Action for Docker

Tools for building, tagging and publishing Docker images.

Usage

Sample workflow that tests, builds, and tags a Docker image.

workflow "Test and Build Container" {
  on = "push"
  resolves = ["Build"]
}
 action "Lint" {
  uses = "actions/action-builder/shell@master"
  runs = "make"
  args = "lint"
}
 action "Test" {
  uses = "actions/action-builder/shell@master"
  runs = "make"
  args = "test"
}
 action "Build" {
  needs = ["Test", "Lint"]
  uses = "actions/action-builder/docker@master"
  runs = "make"
  args = "build"
}

License

MIT. Please see additional information in each subdirectory.

About

A collection of GitHub Actions that can be used to automate the testing, building, and deployment of custom GitHub Actions using workflows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published