This commit is contained in:
xRain 2023-08-22 12:26:31 +08:00
parent ea6609e5a8
commit 6efc06a551

View File

@ -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 }}
- 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 }}'