From a6526eef0f71a626f6fb15a42fcd2a005a608433 Mon Sep 17 00:00:00 2001 From: xRain Date: Thu, 18 Apr 2024 15:53:09 +0800 Subject: [PATCH] ok --- action.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..bb9acf7 --- /dev/null +++ b/action.yml @@ -0,0 +1,21 @@ +# action.yml +name: 'build docker image and push to code' +description: 'build docker image and push to simcu code' +inputs: + dockerfile: + description: 'if set, will use this to build' + required: true + default: '' +runs: + using: 'composite' + steps: + - name: build docker image use custom dockerfile + uses: docker://docker:git + with: + entrypoint: "/bin/sh" + args: | + -c 'cat ${{ inputs.dockerfile || 'Dockerfile' }} && docker build -t ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} -f ${{ inputs.dockerfile || 'Dockerfile' }} . && \ + echo ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}已经构建完了 && \ + docker login ${{env.DOCKER_REGISTRY}} -u ${{env.DOCKER_USER}} -p ${{env.DOCKER_PASS}} && \ + docker push ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} && \ + echo ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}推送成功' \ No newline at end of file