This commit is contained in:
xRain 2024-04-18 03:02:47 +08:00
parent 51458b3727
commit 0122b62cf5
1 changed files with 1 additions and 14 deletions

View File

@ -28,25 +28,12 @@ runs:
echo "已经构建完DOCKERFILE了" && \
cat Dockerfile'
- name: build docker image
if: ${{ inputs.dockerfile == '' }}
uses: docker://docker:git
with:
entrypoint: "/bin/sh"
args: |
-c 'cat Dockerfile && docker build -t ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} . && \
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 }}推送成功'
- name: build docker image use custom dockerfile
if: ${{ inputs.dockerfile != '' }}
uses: docker://docker:git
with:
entrypoint: "/bin/sh"
args: |
-c 'cat Dockerfile && docker build -t ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} -f ${{inputs.dockerfile}} . && \
-c 'cat 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 }} && \