-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (45 loc) · 1.44 KB
/
cuda-9.1.ompi-4.0.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: cuda-9.1.ompi-4.0
on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'dgx2/cuda-9.1.ompi-4.0.**'
pull_request:
branches:
- master
paths:
- 'dgx2/cuda-9.1.ompi-4.0.**'
env:
BASE_IMAGE_NAME: cuda-9.1.ompi-4.0
DOCKERHUB_REPO: hpc-base-container
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
jobs:
test:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v2
- name: Test Build image
run: docker build . --file "dgx2/cuda-9.1.ompi-4.0.Dockerfile" --tag $BASE_IMAGE_NAME
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v2
- name: Build image
run: docker build . --file "dgx2/cuda-9.1.ompi-4.0.Dockerfile" --tag $BASE_IMAGE_NAME
- name: Log into registry
run: echo "$DOCKERHUB_TOKEN" | docker login -u $DOCKERHUB_USER --password-stdin
- name: Push image
run: |
IMAGE_ID=$DOCKERHUB_USER/$DOCKERHUB_REPO
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$BASE_IMAGE_NAME
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $BASE_IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION