commit 20ad04ccd69bb906b8e3d3681be0e0bd737a457e Author: xRain Date: Fri Dec 27 05:40:03 2024 +0800 first 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 }}'