2021-11-10 16:59:10 +00:00
|
|
|
name: Docker
|
2020-05-12 10:54:59 +00:00
|
|
|
# https://www.docker.com/blog/first-docker-github-action-is-here
|
2020-06-27 01:46:08 +00:00
|
|
|
# https://github.com/docker/build-push-action
|
2020-04-26 12:01:55 +00:00
|
|
|
on:
|
2020-04-26 20:10:58 +00:00
|
|
|
push:
|
2021-01-12 12:56:20 +00:00
|
|
|
branches: [master, "release/*"]
|
2020-04-26 20:10:58 +00:00
|
|
|
release:
|
2021-05-06 19:05:35 +00:00
|
|
|
types: [published]
|
2020-04-26 12:01:55 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-11-10 16:59:10 +00:00
|
|
|
publish:
|
2020-06-27 20:25:33 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2021-05-19 19:15:58 +00:00
|
|
|
# only on releases
|
|
|
|
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
|
2020-04-26 12:01:55 +00:00
|
|
|
strategy:
|
2020-08-07 13:10:35 +00:00
|
|
|
fail-fast: false
|
2020-04-26 12:01:55 +00:00
|
|
|
matrix:
|
2021-12-21 17:06:15 +00:00
|
|
|
python_version: ["3.7", "3.8", "3.9"]
|
2022-03-08 18:02:32 +00:00
|
|
|
pytorch_version: ["1.8", "1.9", "1.10"]
|
2020-04-26 12:01:55 +00:00
|
|
|
steps:
|
2020-06-27 01:38:25 +00:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2020-05-12 10:54:59 +00:00
|
|
|
|
|
|
|
- name: Get release version
|
|
|
|
id: get_version
|
2020-12-18 23:20:49 +00:00
|
|
|
run: echo "::set-output name=RELEASE_VERSION::$(echo ${GITHUB_REF##*/})"
|
2020-05-12 10:54:59 +00:00
|
|
|
|
|
|
|
- name: Publish Releases to Docker
|
|
|
|
uses: docker/build-push-action@v1.1.0
|
|
|
|
with:
|
|
|
|
repository: pytorchlightning/pytorch_lightning
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
2020-10-26 10:47:09 +00:00
|
|
|
dockerfile: dockers/release/Dockerfile
|
2020-12-18 23:20:49 +00:00
|
|
|
build_args: PYTHON_VERSION=${{ matrix.python_version }},PYTORCH_VERSION=${{ matrix.pytorch_version }},LIGHTNING_VERSION=${{ steps.get_version.outputs.RELEASE_VERSION }}
|
|
|
|
tags: "${{ steps.get_version.outputs.RELEASE_VERSION }}-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }},latest-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}"
|
2020-09-22 23:41:35 +00:00
|
|
|
timeout-minutes: 55
|
2021-03-19 21:25:46 +00:00
|
|
|
|
2021-05-19 19:15:58 +00:00
|
|
|
- name: Publish Latest to Docker
|
|
|
|
uses: docker/build-push-action@v1.1.0
|
2021-10-26 11:58:20 +00:00
|
|
|
# only on releases and latest Python and PyTorch
|
2022-03-11 09:20:47 +00:00
|
|
|
if: matrix.python_version == '3.9' && matrix.pytorch_version == '1.10'
|
2021-05-19 19:15:58 +00:00
|
|
|
with:
|
|
|
|
repository: pytorchlightning/pytorch_lightning
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
dockerfile: dockers/release/Dockerfile
|
|
|
|
build_args: PYTHON_VERSION=${{ matrix.python_version }},PYTORCH_VERSION=${{ matrix.pytorch_version }},LIGHTNING_VERSION=${{ steps.get_version.outputs.RELEASE_VERSION }}
|
|
|
|
tags: "latest"
|
|
|
|
timeout-minutes: 55
|