[pre-commit.ci] pre-commit suggestions (#144) #307
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Building dockers | |
on: # Trigger the workflow on push or pull request, but only for the master branch | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
paths: | |
- "actions/**" | |
# based on https://github.com/pypa/gh-action-pypi-publish | |
jobs: | |
docker-build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
pytorch_version: ["1.8.1", "1.9.1"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
if: ${{ github.repository_owner == 'Lightning-AI' && github.event_name == 'push' }} | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and Publish Docker Hub | |
# publish master/release | |
uses: docker/build-push-action@v5 | |
with: | |
build-args: | | |
PYTORCH_VERSION=${{ matrix.pytorch_version }} | |
file: _actions/Dockerfile | |
push: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} | |
tags: pytorchlightning/ecosystem-ci:pt${{ matrix.pytorch_version }} | |
timeout-minutes: 25 |