2024-12-26 21:40:03 +00:00
|
|
|
name: "update docker image on swarm"
|
|
|
|
description: "update docker image on swarm"
|
|
|
|
inputs:
|
|
|
|
docker:
|
|
|
|
description: "DOCKER_HOST地址"
|
|
|
|
required: true
|
|
|
|
default: tcp://n1.coce.zone:2375
|
|
|
|
service:
|
|
|
|
description: "SERVICE名称"
|
|
|
|
required: true
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- uses: docker://docker:cli
|
|
|
|
env:
|
|
|
|
DOCKER_HOST: ${{ inputs.docker }}
|
|
|
|
with:
|
2024-12-26 21:43:57 +00:00
|
|
|
entrypoint: "/bin/sh"
|
2024-12-26 21:40:03 +00:00
|
|
|
args: |
|
|
|
|
-c 'docker login ${{vars.DOCKER_REGISTRY}} -u ${{vars.DOCKER_USER}} -p ${{vars.DOCKER_PASS}} && docker service update {{inputs.service}} -d --with-registry-auth --image ${{vars.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}'
|