From b299daac0fca22fd3fd1519337aee3db6827c452 Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Wed, 11 Dec 2024 11:46:08 -0600 Subject: [PATCH] Create GitHub Actions workflow to build and push Docker Images --- .github/workflows/docker.yaml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/docker.yaml diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000..1e634c9 --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,48 @@ +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 }} \ No newline at end of file