forked from pytorch/builder
-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (39 loc) · 1.03 KB
/
build-libtorch-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Build libtorch docker images
on:
push:
branches:
master
paths:
- libtorch/Dockerfile
- 'common/*'
- .github/workflows/build-libtorch-images.yml
pull_request:
paths:
- libtorch/Dockerfile
- 'common/*'
- .github/workflows/build-libtorch-images.yml
env:
DOCKER_REGISTRY: "docker.io"
DOCKER_BUILDKIT: 1
DOCKER_ID: ${{ secrets.DOCKER_ID }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
WITH_PUSH: ${{ github.event_name == 'push' }}
jobs:
build-docker:
runs-on: linux.2xlarge
strategy:
matrix:
cuda_version: ["10.2", "11.1", "11.3", "cpu"]
env:
CUDA_VERSION: ${{ matrix.cuda_version }}
steps:
- name: Checkout PyTorch builder
uses: actions/checkout@v2
- name: Authenticate if WITH_PUSH
run: |
if [[ "${WITH_PUSH}" == true ]]; then
echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin
fi
- name: Build Docker Image
run: |
libtorch/build_docker.sh