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: true
app_name:
description: 'Target Heroku app name'
required: true
github_token:
description: 'Token for github package repo'
required: true
In 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: true
pipeline:
description: 'A heroku pipline id to add the new app to'
required: true
stage:
description: 'A stage to add the app to'
required: false
default: 'development'
token:
description: 'API token of the heroku account'
required: true
outputs:
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: true
description: '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
develop
andmaster
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.js
files in your new folder - Setup the action to run
build/index.js
and fill out the other relevant fields inaction.yml
# auto/<your action name>/action.yml
name: ''
description: ''
inputs:
input_name:
description: ''
required: true
outputs:
output_name:
description: ''
runs:
using: 'node12'
main: 'build/index.js'
- Create functionality in
handler.js
and 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 action
uses: STEM-C/auto/<your action name>@vX.X