11name : docker-jupyter-singleuser-cpu-gpu-hybrid-architecture
22
33on :
4-
54 push :
65 branches : ['**']
76 tags : ['v*.*.*']
87 pull_request :
98 branches : ['**']
109 release :
1110 types : [published]
12-
13- # Allows you to run this workflow manually from the Actions tab
1411 workflow_dispatch :
1512
1613jobs :
@@ -23,44 +20,28 @@ jobs:
2320 uses : actions/checkout@v3
2421 with :
2522 submodules : true
23+
2624 - name : Git Submodule Update
2725 run : |
28- git submodule update --init --recursive
29- git pull --recurse-submodules origin main
30- git submodule update --remote --recursive
31-
32- - name : Log in to Docker Hub
33- if : ${{ github.actor != 'dependabot[bot]' }}
34- uses : docker/login-action@v3
35- with :
36- username : ${{ secrets.DOCKER_HUB_USERNAME }}
37- password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
26+ git submodule update --init --remote --recursive
3827
3928 - name : Metadata for Docker
4029 id : meta
4130 uses : docker/metadata-action@v5
4231 with :
43- images : |
44- cogstacksystems/jupyter-singleuser:latest
32+ images : cogstacksystems/jupyter-singleuser:latest
33+
4534 - name : Get and Set Release Version
4635 id : release_version
4736 run : |
4837 if [[ "${GITHUB_REF#refs/heads/}" == "${GITHUB_REF}" ]]; then
49- # it's a tag or something else
5038 VERSION="${GITHUB_REF#refs/*/}"
5139 else
5240 VERSION="latest"
5341 fi
5442 echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
5543 echo "release_version=$VERSION" >> $GITHUB_OUTPUT
5644
57- - name : Tag Setup
58- run : |
59- if [[ "${RELEASE_VERSION}" == "main" ]]; then
60- echo "RELEASE_VERSION=latest" >> $GITHUB_ENV
61- else
62- echo "RELEASE_VERSION=${RELEASE_VERSION#?}" >> $GITHUB_ENV
63- fi
6445 build-cpu :
6546 needs : setup
6647 runs-on : ubuntu-22.04
7051 steps :
7152 - name : Checkout
7253 uses : actions/checkout@v3
54+
55+ - name : Log in to Docker Hub
56+ if : ${{ github.actor != 'dependabot[bot]' }}
57+ uses : docker/login-action@v3
58+ with :
59+ username : ${{ secrets.DOCKER_HUB_USERNAME }}
60+ password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
61+
7362 - name : Set up Docker Buildx
7463 uses : docker/setup-buildx-action@v3
64+
7565 - name : Build and Push CPU Image
7666 uses : docker/build-push-action@v6
7767 with :
@@ -80,20 +70,32 @@ jobs:
8070 build-args : |
8171 CPU_ARCHITECTURE=${{ matrix.platform }}
8272 tags : cogstacksystems/jupyter-singleuser:${{ needs.setup.outputs.release_version }}-${{ matrix.platform }}
83- push : true
73+ push : ${{ github.actor != 'dependabot[bot]' }}
8474
8575 build-gpu :
8676 needs : setup
8777 runs-on : ubuntu-22.04
8878 steps :
79+ - name : Checkout
80+ uses : actions/checkout@v3
81+
82+ - name : Log in to Docker Hub
83+ if : ${{ github.actor != 'dependabot[bot]' }}
84+ uses : docker/login-action@v3
85+ with :
86+ username : ${{ secrets.DOCKER_HUB_USERNAME }}
87+ password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
88+
89+ - name : Set up Docker Buildx
90+ uses : docker/setup-buildx-action@v3
91+
8992 - name : Build and Push GPU Image
9093 uses : docker/build-push-action@v6
9194 with :
92- context : ${{ env.CONTEXT }}
95+ context : ./
9396 platforms : linux/amd64
9497 file : Dockerfile_singleuser_gpu
9598 build-args : |
9699 CPU_ARCHITECTURE=amd64
97- tags : |
98- cogstacksystems/jupyter-singleuser-gpu:${{ needs.setup.outputs.release_version }}-amd64
99- push : true
100+ tags : cogstacksystems/jupyter-singleuser-gpu:${{ needs.setup.outputs.release_version }}-amd64
101+ push : ${{ github.actor != 'dependabot[bot]' }}
0 commit comments