From 20ad04ccd69bb906b8e3d3681be0e0bd737a457e Mon Sep 17 00:00:00 2001 From: xRain Date: Fri, 27 Dec 2024 05:40:03 +0800 Subject: [PATCH] first --- action.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..ae801df --- /dev/null +++ b/action.yml @@ -0,0 +1,20 @@ +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 }}'