test
This commit is contained in:
parent
05caf5b155
commit
af0f2e4b22
13
action.yml
13
action.yml
@ -29,11 +29,24 @@ runs:
|
|||||||
cat Dockerfile'
|
cat Dockerfile'
|
||||||
|
|
||||||
- name: build docker image
|
- name: build docker image
|
||||||
|
if: ${{ inputs.dockerfile == '' }}
|
||||||
uses: docker://docker:git
|
uses: docker://docker:git
|
||||||
with:
|
with:
|
||||||
entrypoint: "/bin/sh"
|
entrypoint: "/bin/sh"
|
||||||
args: |
|
args: |
|
||||||
-c 'docker build -t ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} . && \
|
-c '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 'docker build -t ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} -f ${{inputs.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…
x
Reference in New Issue
Block a user