haystack/.github/workflows/docker_build.yml
Sara Zan 9dc89d2bd2
Fix dependency related build issues in Dockerfiles (#2135)
* Fix a path issue in Dockerfile-GPU

* Fix paths in Dockerfile-GPU

* Add workflow_dispatch to docker build task

* Remove reference to optional component from ui/, not needed anymore

* Move pytorch installation last to avoid replacing it later

* Remove optional import from rest_api too, no more needed

* Change path in ui/Dockerfile

* ui container works again

* Complete review of import paths

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-09 17:35:18 +01:00

56 lines
1.3 KiB
YAML

name: docker-build
on:
workflow_dispatch:
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