1+ name : docker-jupyter-singleuser-gpu
2+
3+ on :
4+
5+ push :
6+ branches : [ master ]
7+ pull_request :
8+ branches : [ master ]
9+
10+ release :
11+ types : [published]
12+
13+ # Allows you to run this workflow manually from the Actions tab
14+ workflow_dispatch :
15+
16+ jobs :
17+
18+ build :
19+
20+ runs-on : ubuntu-latest
21+
22+ env :
23+ working-directory : ./services/jupyter-hub
24+
25+ # Steps represent a sequence of tasks that will be executed as part of the job
26+ steps :
27+ - name : Set up QEMU
28+ uses : docker/setup-qemu-action@v1
29+
30+ - name : Set up Docker Buildx
31+ uses : docker/setup-buildx-action@v1
32+
33+ # Checkout the repository to the GitHub Actions runner
34+ - name : Checkout
35+ uses : actions/checkout@v2
36+ with :
37+ submodules : true
38+
39+ # Update references for any submodules
40+ - name : Git Sumbodule Update
41+ run : |
42+ git submodule update --init --recursive
43+ git pull --recurse-submodules origin master
44+ git submodule update --remote --recursive
45+
46+ - name : Log in to Docker Hub
47+ uses : docker/login-action@v1
48+ with :
49+ username : ${{ secrets.DOCKER_HUB_USERNAME }}
50+ password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
51+
52+ - name : Extract metadata (tags, labels) for Docker
53+ id : meta
54+ uses : docker/metadata-action@v3
55+ with :
56+ images : cogstacksystems/jupyter-singleuser:latest
57+
58+ - name : Get and set release version env var
59+ id : release_version
60+ run : |
61+ echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
62+ echo "::set-output name=RELEASE_VERSION::$RELEASE_VERSION"
63+
64+ - name : output test
65+ run : |
66+ echo ${{ env.RELEASE_VERSION }}
67+ echo $RELEASE_VERSION
68+
69+ - name : set docker release tag name
70+ id : set_release_version
71+ if : ${{ env.RELEASE_VERSION != 'master' }}
72+ run : echo "RELEASE_VERSION=${RELEASE_VERSION#?}" >> $GITHUB_ENV
73+
74+ - name : set docker release tag name
75+ id : set_release_version_latest
76+ if : ${{ env.RELEASE_VERSION == 'master' }}
77+ run : echo "RELEASE_VERSION=latest" >> $GITHUB_ENV
78+
79+ - name : Build and push Docker Jupyter singleuser image with GPU support
80+ uses : docker/build-push-action@v2
81+ with :
82+ context : ./services/jupyter-hub
83+ file : " ./services/jupyter-hub/Dockerfile_singleuser_gpu"
84+ allow : network.host
85+ github-token : ${{ github.token }}
86+ tags : cogstacksystems/jupyter-singleuser-gpu:${{ env.RELEASE_VERSION }}
87+ push : true
88+
89+ - name : Image digest
90+ run : echo ${{ steps.docker_build.outputs.digest }}
0 commit comments