GitHub actions that enable an automated CI/CD pipeline
Build docker images, run the testing harness, push to GitHub Package Repository and Heroku Container Registry, and deploy the image to a target Heroku app
inputs:
image_tag: description: 'Tag of the github package repo image'required: trueapp_name:
description: 'Target Heroku app name'required: truegithub_token:
description: 'Token for github package repo'required: trueIn addition to defining all the inputs in the with section of the target workflow, you must set the HEROKU_API_KEY in the env section.
This action uses docker with an entrypoint script. The base image is in the directory as
Dockerfile.build. It is currently being hosted on DockerHub because GitHub Package Repository does not allow for non-auth public pulls
Create and delete Heroku apps in a target pipeline
inputs:
base:
description: 'The base name of the app'required: truepipeline: description: 'A heroku pipline id to add the new app to'required: truestage:
description: 'A stage to add the app to'required: falsedefault: 'development'token:
description: 'API token of the heroku account'required: trueoutputs:
app_name: description: 'The name of the app that is created'database_url:
description: 'The postgresql url of the provisioned db'Automatically tags on pull requests into master
inputs:
repo_token:
required: truedescription: 'The GITHUB_TOKEN secret'All dependencies are managed in a central package.json. Each action will be bundled individually and only include what they use
Runs on all PR to
developandmaster
Test all actions that have a test.js
Runs on all pushes to
master
Uses ncc to compile each javascript based action into its own build/index.js file
Official actions documentation
- Create a new folder
<your action name>in the project root - Create
action.yml,handler.js, andtest.jsfiles in your new folder - Setup the action to run
build/index.jsand fill out the other relevant fields inaction.yml
# auto/<your action name>/action.ymlname: ''description: ''inputs:
input_name:
description: ''required: trueoutputs:
output_name: description: ''runs:
using: 'node12'main: 'build/index.js'- Create functionality in
handler.jsand write some tests intest.js - Merge your branch into
master - Create a new release with an incremental minor version
- Use your action in a workflow
- name: Use your actionuses: STEM-C/auto/<your action name>@vX.X