test
This commit is contained in:
parent
51458b3727
commit
0122b62cf5
15
action.yml
15
action.yml
@ -28,25 +28,12 @@ runs:
|
|||||||
echo "已经构建完DOCKERFILE了" && \
|
echo "已经构建完DOCKERFILE了" && \
|
||||||
cat 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
|
- name: build docker image use custom dockerfile
|
||||||
if: ${{ inputs.dockerfile != '' }}
|
|
||||||
uses: docker://docker:git
|
uses: docker://docker:git
|
||||||
with:
|
with:
|
||||||
entrypoint: "/bin/sh"
|
entrypoint: "/bin/sh"
|
||||||
args: |
|
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 }}已经构建完了 && \
|
echo ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}已经构建完了 && \
|
||||||
docker login ${{env.DOCKER_REGISTRY}} -u ${{env.DOCKER_USER}} -p ${{env.DOCKER_PASS}} && \
|
docker login ${{env.DOCKER_REGISTRY}} -u ${{env.DOCKER_USER}} -p ${{env.DOCKER_PASS}} && \
|
||||||
docker push ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} && \
|
docker push ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} && \
|
||||||
|
Loading…
Reference in New Issue
Block a user