Skip to content

Warning

You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

Update k8s image

Actions
Updates a container tag inside a Kubernetes manifest
v1.7
Star (3)

update-k8s-image action

This action updates a container image tag in a Kubernetes deployment file.

Usage

- id: update-image
  uses: Charlyzzz/update-k8s-image
  with:
    manifest-path: path/to/deployment.yaml
    new-image-tag: latest
    name: my-backend

# Example of using the output
- id: test
  run: curl ${{ steps.update-image.outputs.old-image-tag }}

Inputs

Inputs

  • manifest-path: (Required) Deployment file's path.

  • new-image-tag: (Optional) Runtime to use for the function. Defaults to ${{ github.sha }}.

  • container-name: (Required) Name of the container that uses the image. This parameter is used to target only one container.

Outputs

  • old-image-tag: Image tag before replacement.

Scenarios

Set backend version to latest

### path/to/my/deployment.yaml ###
#
#    apiVersion: apps/v1
#    kind: Deployment
#    spec:
#      replicas: 1
#      selector:
#        matchLabels:
#          app: my-app
#      template:
#        metadata:
#          labels:
#            app: my-app
#        spec:
#          containers:
#            - name: backend
#              image: my-registry/backend:1.0
#              ports:
#                - containerPort: 80
#            - name: sidecar
#              image: sidecar:2.0
#              ports:
#                - containerPort: 9999
steps:
  - uses: Charlyzzz/update-k8s-image
    with:
      manifest-path: path/to/my/deployment.yaml
      new-image-tag: latest
      name: backend

License

The scripts and documentation in this project are released under the MIT License

Update k8s image 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

Updates a container tag inside a Kubernetes manifest
v1.7

Update k8s image 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.