⚠️ This action is deprecated please use: duplocloud/actions/update-image
This action will update one or more services running in Duplo.
Here is an example of what to put in your .github/workflows/build-and-deploy.yml
file to use this workflow.
name: Build and Deploy
on:
push:
branches:
- develop # branch to trigger on
jobs:
deploy:
# This example updates a service named "nginx" to use an image "nginx:latest"
name: Deploy with DuploCloud
runs-on: ubuntu-latest
steps:
- name: service-update
uses: duplocloud/ghactions-service-update@master
with:
duplo_host: https://mysystem.duplocloud.net
duplo_token: ${{ secrets.DUPLO_TOKEN }}
tenant: default
services: |-
[
{ "Name": "nginx", "Image": "nginx:latest" }
]
name: Build and Deploy
on:
push:
branches:
- develop # branch to trigger on
jobs:
deploy:
# This example updates 2 services to use the busybox image
name: Deploy with DuploCloud
runs-on: ubuntu-latest
steps:
- name: service-update
uses: duplocloud/ghactions-service-update@master
with:
duplo_host: https://mysystem.duplocloud.net
duplo_token: ${{ secrets.DUPLO_TOKEN }}
use_bulk_api: true
tenant: default
services: |-
[
{ "Name": "test1", "Image": "busybox:latest" }
{ "Name": "test2", "Image": "busybox:latest" }
]
name: Build and Deploy
on:
push:
branches:
- develop # branch to trigger on
jobs:
deploy:
# This example updates a service named "nginx" to use an image "nginx:latest"
name: Deploy with DuploCloud
runs-on: ubuntu-latest
steps:
- name: service-update
uses: duplocloud/ghactions-service-update@master
with:
duplo_host: https://mysystem.duplocloud.net
duplo_token: ${{ secrets.DUPLO_TOKEN }}
tenant: default
ecs_services: |-
[
{ "Name": "nginx", "Image": "nginx:latest" }
]
Name | Description | Required | Default |
---|---|---|---|
tenant | Tenant name or ID | true | unset |
services | JSON for the services to be updated (see below for JSON format) | false | [] |
ecs_services | JSON for the ECS services to be updated (see below for JSON format) | false | [] |
duplo_host | Base URL of the Duplo installation (no trailing slash) - defaults to duplo_host env var |
true (if no env var) | unset |
duplo_token | API token - defaults to duplo_token env var |
true (if no env var) | unset |
Key | Description | Required | Default |
---|---|---|---|
Name | Name of the Duplo service | true | unset |
Image | Docker image to deploy | true | unset |
AgentPlatform | Agent platform identifier | false | (retain existing value in Duplo) |
Env | Overwrites all environment variables (see below for JSON format) | false | (retain existing value in Duplo) |
MergeEnv | Merges only the given environment variables (see below for JSON format) | false | unset |
DeleteEnv | Deletes environment variables (see below for JSON format) | false | unset |
AllocationTags | Allocation Tags | false | (retain existing value in Duplo) |
This format matches what you would enter in the Environment variables field in the DuploCloud UI (but in JSON format).
For non-Kubernetes services, the format of the Env
or MergeEnv
fields is a simple JSON object, where keys are the env var names, and values are the env var values.
Example:
{
"MY_ENV_VAR" : "my value",
"OTHER_ENV_VAR" : "other value"
}
For Kubernetes services, the format of the Env
or MergeEnv
fields matches the Kubernetes format for environment variables (but in JSON format).
Example:
[
{
"Name": "MY_ENV_VAR",
"Value": "my value"
},
{
"Name": "MY_ENV_VAR_FROM_A_CONFIG_MAP",
"ValueFrom": {
"ConfigMapKeyRef": {
"Name": "my-kubernetes-configmap",
"Key": "my-key-in-the-configmap",
}
}
},
{
"Name": "MY_ENV_VAR_FROM_A_SECRET",
"ValueFrom": {
"SecretKeyRef": {
"Name": "my-kubernetes-secret",
"Key": "my-key-in-the-secret",
}
}
}
]
This field is a simple JSON array of strings, listing the environment variables to be deleted: ["MY_ENV_VAR", "OTHER_ENV_VAR"]
Key | Description | Required | Default |
---|---|---|---|
Name | Name of the ECS service | true | unset |
Image | Docker image to deploy | true | unset |
None.