This repository contains actions that can be used to automate the testing, building, and deployment of custom GitHub Actions using workflows.
- Single Action in a Repository - Simple GitHub Action that wraps a separate command-line as one Action.
- Multiple Actions in a Repository - Multiple GitHub Actions that expose related, modular actions separated into sub-folder, eg. this repository.
- Download the appropriate tar file from the releases page and copy it into your repository.
- Untar the copied file, creating a new set of Makefiles and configuration files in your repository.
- Copy
action_template.mk
into the sub-folder of each of your actions, and rename it toMakefile
. - For each of your actions, update the new
Makefile
to:- Use the
include
directives for any of the helper files that make sense for your Action. - Set the target depedencies for each of the default targets that make sense for your Action.
- Add any additional actions that you would like performed to the target definitions.
- If you leave everything for the target blank, it will be skipped, but don't delete it or you will get errors.
- Use the
- 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.
- Add
IMAGE_NAME=<action_name>
to each Action's Makefile. Replace<action_name
with the name of the image to publish.
- Add
These have similar functionality to a number of top level actions. The key differences are that they aggregate some functionality, and include make
.
Tools for linting and testing shell scripts, as well as linting dockerfiles, using makefiles
and dockerfile_lint.
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"
}
Tools for building, tagging and publishing Docker images.
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"
}
MIT. Please see additional information in each subdirectory.