Skip to content

Do not remove ~/work #19

Do not remove ~/work

Do not remove ~/work #19

name: Build Breeder Notebook
on:
push:
branches:
- 'main'
paths:
- 'breeder-notebook/**'
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
steps:
# Setting up Docker Buildx with docker-container driver is required
# at the moment to be able to use a subdirectory with Git context
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# - name: Cache Docker layers
# uses: actions/cache@v2
# with:
# path: /tmp/.buildx-cache
# key: ${{ runner.os }}-single-buildx-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-single-buildx
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:breeder-notebook"
push: true
tags: maizegenetics/breeder-notebook:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
# Source: https://evilmartians.com/chronicles/build-images-on-github-actions-with-docker-layer-caching
# - name: Move cache
# run: |
# rm -rf /tmp/.buildx-cache
# mv /tmp/.buildx-cache-new /tmp/.buildx-cache