Skip to content

Create GitHub Actions workflow to build and push Docker Images #1

Create GitHub Actions workflow to build and push Docker Images

Create GitHub Actions workflow to build and push Docker Images #1

Workflow file for this run

name: Build and Push Docker Images
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
image:
- name: base
dockerfile: ./images/Dockerfile
- name: matlab
dockerfile: ./images/Dockerfile.matlab
- name: gpu
dockerfile: ./images/Dockerfile
- name: gpu-matlab
dockerfile: ./images/Dockerfile
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- 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: .
file: ${{ matrix.dockerfile }}
push: true
tags: |
${{ vars.DOCKER_USERNAME }}/dandihub:latest-${{ matrix.name }}