Skip to content

Commit

Permalink
Merge pull request #212 from kabilar/docker-publish
Browse files Browse the repository at this point in the history
Create GitHub Actions workflows to build and push Docker Images
  • Loading branch information
kabilar authored Dec 12, 2024
2 parents aa9421d + 409599e commit 731e0ad
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 5 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/docker-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Push Docker Images

on:
push:
branches:
- main
paths:
- 'Dockerfile*'
workflow_dispatch:

jobs:
docker-push:
runs-on: ubuntu-latest

strategy:
matrix:
image:
- name: base
dockerfile: Dockerfile
- name: matlab
dockerfile: Dockerfile.matlab
- name: gpu
dockerfile: Dockerfile.gpu
- name: gpu-matlab
dockerfile: Dockerfile.gpu.matlab
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push Docker Image
uses: docker/build-push-action@v6
with:
context: images
file: ${{ matrix.dockerfile }}
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/dandihub:latest-${{ matrix.image.name }}
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/dandihub:latest-${{ matrix.image.name }}
cache-to: type=inline
41 changes: 41 additions & 0 deletions .github/workflows/docker-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build Docker Images

on:
pull_request:
paths:
- 'Dockerfile*'
workflow_dispatch:

jobs:
docker-test:
runs-on: ubuntu-latest

strategy:
matrix:
image:
- name: base
dockerfile: Dockerfile
- name: matlab
dockerfile: Dockerfile.matlab
- name: gpu
dockerfile: Dockerfile.gpu
- name: gpu-matlab
dockerfile: Dockerfile.gpu.matlab
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker Image
uses: docker/build-push-action@v6
with:
context: images
file: ${{ matrix.dockerfile }}
push: false
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/dandihub:latest-${{ matrix.image.name }}
cache-to: type=inline
10 changes: 5 additions & 5 deletions envs/shared/jupyterhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ singleuser:
display_name: "Standard"
default: true
kubespawner_override:
image: "${singleuser_image_repo}:${singleuser_image_tag}"
image: "${singleuser_image_repo}:${singleuser_image_tag}-base"
kubespawner_override:
image_pull_policy: Always
cpu_limit: 2
Expand All @@ -69,7 +69,7 @@ singleuser:
# display_name: "Standard"
# default: true
# kubespawner_override:
# image: "${singleuser_image_repo}:${singleuser_image_tag}"
# image: "${singleuser_image_repo}:${singleuser_image_tag}-base"
# matlab:
# display_name: "MATLAB (must provide your own license)"
# kubespawner_override:
Expand All @@ -93,7 +93,7 @@ singleuser:
display_name: "Standard"
default: true
kubespawner_override:
image: "${singleuser_image_repo}:${singleuser_image_tag}"
image: "${singleuser_image_repo}:${singleuser_image_tag}-base"
matlab:
display_name: "MATLAB (must provide your own license)"
kubespawner_override:
Expand All @@ -118,7 +118,7 @@ singleuser:
display_name: "Standard"
default: true
kubespawner_override:
image: "${singleuser_image_repo}:${singleuser_image_tag}"
image: "${singleuser_image_repo}:${singleuser_image_tag}-base"
matlab:
display_name: "MATLAB (must provide your own license)"
kubespawner_override:
Expand All @@ -141,7 +141,7 @@ singleuser:
display_name: "Standard"
default: true
kubespawner_override:
image: "${singleuser_image_repo}:${singleuser_image_tag}"
image: "${singleuser_image_repo}:${singleuser_image_tag}-base"
matlab:
display_name: "MATLAB (must provide your own license)"
kubespawner_override:
Expand Down

0 comments on commit 731e0ad

Please sign in to comment.