github-actions

Build docker image

Build the docker image, with or without cache and push to the Github container registry. If the package does not exist yet, it will create it and configure permissions and visibility automatically. For more information, read the Github documentation.

It creates 2 tags:

If caching is enabled via reuse-cache, the caching used depends on the setting of max-cache

max-cache=true is preferred for multi-stage builds.

Note that the cache hit ratio for a workflow running build can be seen on the workflow summary page.

Optionally (recommended) scan the image for vulnerabilities using Snyk.

A service that uses this action with reuse-cache = true, should also have a cache refresh workflow that has reuse-cache = false that runs weekly and on-demand. This is required to refresh the underlying cache so it picks up any underlying image changes.

Inputs

Outputs

Example

- name: Build and push docker image
  uses: DFE-Digital/github-actions/build-docker-image@master
  with:
    github-token: $