From 6efc06a551a2d769f27bd5fcf1e8edeb42df8206 Mon Sep 17 00:00:00 2001 From: xRain Date: Tue, 22 Aug 2023 12:26:31 +0800 Subject: [PATCH] test --- action.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index e1afd6d..27d0735 100644 --- a/action.yml +++ b/action.yml @@ -8,12 +8,19 @@ runs: with: args: dotnet publish -r linux-x64 -c Release --self-contained -o dist -p:AssemblyName=App - - shell: sh - run: | - echo "FROM mcr.microsoft.com/dotnet/runtime:7.0" > Dockerfile - echo "COPY dist /home" >> Dockerfile - echo "WORKDIR /home" >> Dockerfile - echo "ENTRYPOINT [\"./App\"]" >> Dockerfile - docker build -t ${{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 }} \ No newline at end of file + - uses: docker://ubuntu:latest + with: + entrypoint: "/bin/bash" + args: | + -c 'echo "FROM mcr.microsoft.com/dotnet/runtime:7.0" > Dockerfile' + -c 'echo "COPY dist /home" >> Dockerfile' + -c 'echo "WORKDIR /home" >> Dockerfile' + -c 'echo "ENTRYPOINT [\"./App\"]" >> Dockerfile' + + - uses: docker://docker:git + with: + entrypoint: "/bin/bash" + args: | + -c 'docker build -t ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} .' + -c 'docker login ${{env.DOCKER_REGISTRY}} -u ${{env.DOCKER_USER}} -p ${{env.DOCKER_PASS}}' + -c 'docker push ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}' \ No newline at end of file