2020-05-10 21:04:51 +00:00
|
|
|
name: Publish Docker Releases
|
2020-05-12 10:54:59 +00:00
|
|
|
# https://www.docker.com/blog/first-docker-github-action-is-here
|
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-12 10:54:59 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Publish Master to Docker
|
|
|
|
# publish master
|
|
|
|
uses: docker/build-push-action@v1.1.0
|
|
|
|
if: github.event_name == 'push'
|
|
|
|
with:
|
|
|
|
repository: 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 }}
|
|
|
|
tags: "nightly-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}"
|
|
|
|
timeout-minutes: 30
|
|
|
|
|
|
|
|
- name: Get release version
|
|
|
|
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
|
|
|
|
id: get_version
|
|
|
|
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF##*/})
|
|
|
|
|
|
|
|
- name: Publish Releases to Docker
|
|
|
|
# only on releases
|
|
|
|
uses: docker/build-push-action@v1.1.0
|
|
|
|
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
|
|
|
|
with:
|
|
|
|
repository: 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=${{ env.RELEASE_VERSION }}
|
|
|
|
tags: "${{ env.RELEASE_VERSION }}-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }},latest-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}"
|
|
|
|
timeout-minutes: 30
|