haystack/.github/workflows/docker_build.yml
2022-01-19 10:26:17 +01:00

55 lines
1.2 KiB
YAML

name: docker-build
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- dockerfile: Dockerfile
repository: deepset/haystack-cpu
- dockerfile: Dockerfile-GPU
repository: deepset/haystack-gpu
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
${{ matrix.repository }}
flavor: |
latest=true
tags: |
type=ref,event=tag
type=sha,format=long,prefix=
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push docker image
uses: docker/build-push-action@v2
with:
file: ${{ matrix.dockerfile }}
tags: ${{ steps.meta.outputs.tags }}
push: true
cache-from: type=registry,ref=${{ matrix.repository }}:latest
cache-to: type=inline