Skip to content

Merge pull request #34 from LeidenUniversityLibrary/docker-meta-action #8

Merge pull request #34 from LeidenUniversityLibrary/docker-meta-action

Merge pull request #34 from LeidenUniversityLibrary/docker-meta-action #8

Workflow file for this run

name: Build and Push Docker Image
on:
release:
types: [published]
push:
tags:
- '*'
branches:
- 'actions*'
- 'main'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.CONTAINER_REPO }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PAT }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: Containerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Log out from Docker Hub
run: docker logout