From 7f64ad7a331b4cad958d7864a5d2a8acb3d16a45 Mon Sep 17 00:00:00 2001 From: Justus Schock <12886177+justusschock@users.noreply.github.com> Date: Sun, 10 May 2020 23:04:51 +0200 Subject: [PATCH] Fix Docker Pipeline (#1765) * Update and rename docker_builds.yml to docker_nightly_builds.yml * Update and rename docker_nightly_builds.yml to docker_builds.yml * Update docker_builds.yml * Update .github/workflows/docker_builds.yml Co-authored-by: Jirka Borovec --- .github/workflows/docker-builds.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 736ff72460..c63515256c 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -1,7 +1,7 @@ -name: Publish Docker +name: Publish Docker Releases on: push: - branches: + branches: - master release: types: @@ -15,22 +15,27 @@ jobs: python_version: [3.6, 3.7, 3.8] pytorch_version: [1.1, 1.2, 1.3, 1.4, 1.5] steps: - - name: Extract Current Tag - if: contains(github.ref, 'refs/tags/') - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + - name: Extract branch name + if: contains(github.ref, 'refs/tags/') != true + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_tag + - name: Extract Tag name + if: contains(github.ref, 'refs/tags') + shell: bash + run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF#refs/tags/})" - uses: actions/checkout@v2 - name: Publish Releases to Docker # only on releases uses: elgohr/Publish-Docker-Github-Action@2.14 - if: contains(github.ref, 'refs/tags/') && !contains(${{ steps.get_version.outputs.VERSION }}, 'rc') %% !contains(${{ steps.get_version.outputs.VERSION }}, 'dev') + if: contains(github.ref, 'refs/tags/') && !contains(${{ steps.extract_tag.outputs.tag }}, 'rc') && !contains(${{ steps.extract_tag.outputs.tag }}, 'dev') with: name: pytorchlightning/pytorch_lightning username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} dockerfile: docker/Dockerfile - buildargs: PYTHON_VERSION=${{ matrix.python_version }},PYTORCH_VERSION=${{ matrix.pytorch_version }},LIGHTNING_VERSION=${{ steps.get_version.outputs.VERSION }} - tags: "${{ steps.get_version.outputs.VERSION }}-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }},stable-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}" + buildargs: PYTHON_VERSION=${{ matrix.python_version }},PYTORCH_VERSION=${{ matrix.pytorch_version }},LIGHTNING_VERSION=${{ steps.extract_tag.outputs.tag }} + tags: "${{ steps.extract_tag.outputs.tag }}-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }},stable-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}" - name: Publish Master # publish master uses: elgohr/Publish-Docker-Github-Action@2.14 @@ -40,5 +45,5 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} dockerfile: docker/Dockerfile - buildargs: PYTHON_VERSION=${{ matrix.python_version }},PYTORCH_VERSION=${{ matrix.pytorch_version }},LIGHTNING_VERSION=${{ steps.get_version.outputs.VERSION }} + buildargs: PYTHON_VERSION=${{ matrix.python_version }},PYTORCH_VERSION=${{ matrix.pytorch_version }},LIGHTNING_VERSION=${{ steps.extract_branch.outputs.branch }} tags: "nightly-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}"