Skip to content

Using images in GitHub Actions

Andrew Hosgood edited this page Oct 14, 2024 · 3 revisions

Use the Docker build scripts in your GitHub Actions to build images.

This script:

  • runs the Dockerfile through hadolint ignoring rules DL3045 and DL3007
  • builds the image and tags it with the provided version
  • optionally tags the image with latest
  • pushes the image to the container repository of the current project

Computed version numbers

The get-version-tag GitHub Action will provide you with a version tag to use for your images:

The version tag returned will be:

  • a generated calver version number if the branch is main (e.g. 24.06.21.123)
  • the branch name (with slashes replaced with hyphens) for workflows triggered by pushes (e.g. fix-a11y or feature-new-components)
  • the semver version number of the release for workflows triggered by tags with any prefixed v removed (e.g. 1.2.3 for the tag v1.2.3 and 4 for the tag v4)
Clone this wiki locally