Skip to content

add spack for cuda dependencies #22

add spack for cuda dependencies

add spack for cuda dependencies #22

Workflow file for this run

name: Build Docker Images
on:
push:
branches:
- ci-images
pull_request:
branches:
- ci-images
workflow_dispatch:
jobs:
build_and_push:
name: Build and Push Image
runs-on: ubuntu-latest
strategy:
matrix:
image:
- ubuntu20.04-gcc11-x64
- cuda11.4.3-gcc9.4-x64
env:
IMAGE_TAG: nmm0/distbvh-${{ matrix.image }}:ci-images
CACHE_TAG: nmm0/distbvh-${{ matrix.image }}:buildcache
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
if: ${{ github.ref == 'refs/heads/ci-images' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Pull Cached Image
run: docker pull ${{ env.IMAGE_TAG }}
continue-on-error: true
- name: Build Docker images for PR testing
if: ${{ github.event_name == 'pull_request' }}
uses: docker/build-push-action@v4
with:
context: .
file: ${{ matrix.image }}.dockerfile
cache-from: type=registry,ref=docker.io/${{ env.CACHE_TAG }}
push: false
tags: ${{ env.IMAGE_TAG }}
- name: Build and push Docker images on main
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/ci-images' }}
uses: docker/build-push-action@v4
with:
context: .
file: ${{ matrix.image }}.dockerfile
cache-from: type=registry,ref=docker.io/${{ env.CACHE_TAG }}
cache-to: type=registry,ref=docker.io/${{ env.CACHE_TAG }},mode=max
push: true
tags: ${{ env.IMAGE_TAG }}