Skip to content

8.0.2

8.0.2 #22

Workflow file for this run

name: Publish images
on:
release:
types: [published]
jobs:
build_and_push:
name: Build image and push to dockerhub
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to EBRAINS HARBOR
uses: docker/login-action@v2
with:
registry: docker-registry.ebrains.eu
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
hbpmip/portal-backend
docker-registry.ebrains.eu/medical-informatics-platform/portal-backend
- name: Load cached image
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache/portal-backend
key: buildx-backend
restore-keys: buildx-backend
- name: Build and Push image to dockerhub
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache/portal-backend
cache-to: type=local,dest=/tmp/.buildx-cache-new/portal-backend
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move Docker images cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache