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: with:
args: dotnet publish -r linux-x64 -c Release --self-contained -o dist -p:AssemblyName=App args: dotnet publish -r linux-x64 -c Release --self-contained -o dist -p:AssemblyName=App
- shell: sh - uses: docker://ubuntu:latest
run: | with:
echo "FROM mcr.microsoft.com/dotnet/runtime:7.0" > Dockerfile entrypoint: "/bin/bash"
echo "COPY dist /home" >> Dockerfile args: |
echo "WORKDIR /home" >> Dockerfile -c 'echo "FROM mcr.microsoft.com/dotnet/runtime:7.0" > Dockerfile'
echo "ENTRYPOINT [\"./App\"]" >> Dockerfile -c 'echo "COPY dist /home" >> Dockerfile'
docker build -t ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} . -c 'echo "WORKDIR /home" >> Dockerfile'
docker login ${{env.DOCKER_REGISTRY}} -u ${{env.DOCKER_USER}} -p ${{env.DOCKER_PASS}} -c 'echo "ENTRYPOINT [\"./App\"]" >> Dockerfile'
docker push ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}
- 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 }}'