2020-05-10 21:04:51 +00:00
|
|
|
name: Publish Docker Releases
|
2020-04-26 12:01:55 +00:00
|
|
|
on:
|
2020-04-26 20:10:58 +00:00
|
|
|
push:
|
2020-05-10 21:04:51 +00:00
|
|
|
branches:
|
2020-04-26 20:10:58 +00:00
|
|
|
- master
|
|
|
|
release:
|
|
|
|
types:
|
2020-04-26 12:01:55 +00:00
|
|
|
- created
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python_version: [3.6, 3.7, 3.8]
|
|
|
|
pytorch_version: [1.1, 1.2, 1.3, 1.4, 1.5]
|
|
|
|
steps:
|
2020-05-10 21:04:51 +00:00
|
|
|
- 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/})"
|
2020-04-26 20:10:58 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-04-26 12:01:55 +00:00
|
|
|
- name: Publish Releases to Docker
|
|
|
|
# only on releases
|
2020-05-02 12:40:31 +00:00
|
|
|
uses: elgohr/Publish-Docker-Github-Action@2.14
|
2020-05-10 21:04:51 +00:00
|
|
|
if: contains(github.ref, 'refs/tags/') && !contains(${{ steps.extract_tag.outputs.tag }}, 'rc') && !contains(${{ steps.extract_tag.outputs.tag }}, 'dev')
|
2020-04-26 12:01:55 +00:00
|
|
|
with:
|
|
|
|
name: pytorchlightning/pytorch_lightning
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
dockerfile: docker/Dockerfile
|
2020-05-10 21:04:51 +00:00
|
|
|
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 }}"
|
2020-04-26 12:01:55 +00:00
|
|
|
- name: Publish Master
|
|
|
|
# publish master
|
2020-05-02 12:40:31 +00:00
|
|
|
uses: elgohr/Publish-Docker-Github-Action@2.14
|
2020-04-26 12:01:55 +00:00
|
|
|
if: github.event_name == 'push'
|
|
|
|
with:
|
|
|
|
name: pytorchlightning/pytorch_lightning
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
dockerfile: docker/Dockerfile
|
2020-05-10 21:04:51 +00:00
|
|
|
buildargs: PYTHON_VERSION=${{ matrix.python_version }},PYTORCH_VERSION=${{ matrix.pytorch_version }},LIGHTNING_VERSION=${{ steps.extract_branch.outputs.branch }}
|
2020-05-02 12:40:31 +00:00
|
|
|
tags: "nightly-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}"
|