Skip to content

Build and push Docker images to be used in On-Premises Kubernetes cluster

Actions
Build and push docker image into docker registry in the expected format of on-premises k8s-deploy
1.0.4
Latest
Star (1)

build-push-action

Composite action to build and push docker image into docker registry in the expected format of on-premises k8s-deploy.

License Integration

Usage

- name: Build and push docker image
  uses: MP-ES/build-push-action@v1
  with:
    # Server address of Docker registry. If not set then will default to Docker Hub
    # DEFAULT: hub.docker.com
    registry: registry.domain.com

    # Username used to log against the Docker registry
    username: ${{ secrets.USERNAME }}
    
    # Password or personal access token used to log against the Docker registry
    password: ${{ secrets.PASSWORD }}

    # List of build-time variables
    build-args: |
      arg1=value1
      arg2=value2

    # Relative path under $GITHUB_WORKSPACE to place the repository checkout code
    checkout-path: "."

    # Build's context is the set of files located in the specified PATH or URL
    context: "."

    # Path to the Dockerfile
    file: "Dockerfile"

    # The name of docker image, generally the same as the project name
    image: "service name"

    # Control if the image have to be pushed to the registry
    # DEFAULT: true
    push: "true"

Simplified use

If you have a Dockerfile in the root path with no build args and want to build and push the docker image to a private registry you can write something such as:

- name: Build and push docker image
  uses: MP-ES/build-push-action@v1
  with:
    registry: ${{ secrets.REGISTRY_URL }}
    username: ${{ secrets.REGISTRY_USERNAME }}
    password: ${{ secrets.REGISTRY_PASSWORD }}
    image: "service name"

Outputs

Following outputs are available:

Name Type Description
tag String Tag assigned to docker image
digest String Image content-addressable identifier also called a digest
metadata JSON Build result metadata

Build and push Docker images to be used in On-Premises Kubernetes cluster is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Build and push docker image into docker registry in the expected format of on-premises k8s-deploy
1.0.4
Latest

Build and push Docker images to be used in On-Premises Kubernetes cluster is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.