Updates any kind of container service with a new image. For Kubernetes services
(type: service), this action also supports updating sidecar (additional) and
init container images in the same call.
The following input variables can be configured:
| Name | Description | Required | Default Value |
|---|---|---|---|
| name | Service name | Yes | |
| image | Image name for the main container. Optional when only updating sidecar or init container images. | No | |
| type | Options: service, lambda, ecs, cronjob |
No | service |
| container_images | JSON array of sidecar container name/image pairs. Format: [{"name": "sidecar1", "image": "image1:tag"}]. Only supported when type=service. |
No | |
| init_container_images | JSON array of init container name/image pairs. Format: [{"name": "init1", "image": "image1:tag"}]. Only supported when type=service. |
No | |
| wait | Wait for deployment | No | false |
At least one of image, container_images, or init_container_images must be
provided.
name: Deploy Service
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Duplo Setup
uses: duplocloud/actions@main
- name: Update Image
uses: duplocloud/actions/update-image@v1
with:
type: service
name: my-service
image: my-image:latest - name: Update Image
uses: duplocloud/actions/update-image@v1
with:
type: service
name: my-service
image: myregistry/main:v1.2.3
container_images: |
[
{"name": "logger", "image": "myregistry/logger:v1.2.3"},
{"name": "proxy", "image": "myregistry/proxy:v1.2.3"}
]
init_container_images: |
[
{"name": "init-db", "image": "myregistry/init-db:v1.2.3"}
]
wait: "true" - name: Update Sidecars
uses: duplocloud/actions/update-image@v1
with:
type: service
name: my-service
container_images: |
[{"name": "logger", "image": "myregistry/logger:v1.3.0"}]