Skip to content
anchor

GitHub Action

Build n Push

v1.0.2 Latest version

Build n Push

anchor

Build n Push

GitHub Action that build & push Leukocyte-Lab's Dockerfile

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Build n Push

uses: Leukocyte-Lab/build-n-push@v1.0.2

Learn more about this action in Leukocyte-Lab/build-n-push

Choose a version

Build n' Push

Builds and pushes Docker images and logs in to a Docker registry.

Features

Inputs

Example

Features

  • BuildKit SSH support

Inputs

repository

Required Docker repository

username

Required Username used to log in to a Docker registry.

password

Required Password used to log in to a Docker registry.

tags

Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags.

Example:

tags: v1,v1.0

path

Path to the build context. Default to .

dockerfile

Path to the Dockerfile. Defaults to {path}/Dockerfile

Note this path is not releative to the path but is relative to the working directory.

push

Boolean value. Defaults to true.

Whether to push the built image.

ssh_private_key

SSH private key for BuildKit to fetch private data in builds.

ssh

Boolean value. Default to false.

Whether to add --ssh default into build command.

Example

steps:
  - name: Checkout code
    uses: actions/checkout@v2

  - name: Build n' Push images
    uses: Leukocyte-Lab/build-n-push@v1
    env:
      DOCKER_BUILDKIT: 1
    with:
      ssh: true
      ssh_private_key: ${{ secrets.SSH_KEY }}
      repository: myorg/myrepo
      username: ${{ secrets.REGISTRY_USERNAME }}
      password: ${{ secrets.REGISTRY_PASSWORD }}
      registry: registry.myregistry.com
      tags: latest,v1