deploy2swarm/action.yml
2024-12-27 05:40:03 +08:00

21 lines
688 B
YAML

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:
entrypoint: "/bin/bash"
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 }}'