Skip to content

Build Breeder Notebook #10

Build Breeder Notebook

Build Breeder Notebook #10

name: Build Breeder Notebook
env:
IMAGE_NAME: maizegenetics/breeder-notebook
on:
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install Python dependencies for testing
run: |
pip install --upgrade pip
pip install --upgrade -r requirements-dev.txt
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker metadata for image tags
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=edge,branch=main
#- name: Build image
# uses: docker/build-push-action@v4
# with:
# load: true
# push: false
# tags: ${{ steps.meta.outputs.tags }}
# cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
#- name: Run tests
# run: python3 -m pytest tests
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Push image to Docker Hub
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
# cache-from: type=local,src=/tmp/.buildx-cache
- name: Update Docker Hub description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
repository: maizegenetics/breeder-notebook
# Need to manually remove cache because old entries are not deleted
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
#- name: Delete temporary cache
# run: rm -rf /tmp/.buildx-cache