Skip to content

ci: create release (Cytomine-ULiege/Cytomine-cbir#40) #1

ci: create release (Cytomine-ULiege/Cytomine-cbir#40)

ci: create release (Cytomine-ULiege/Cytomine-cbir#40) #1

Workflow file for this run

name: Docker image
on:
push:
tags:
- "*.*.*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up the repository
uses: actions/checkout@v3
- name: Release check
id: release
run: |
if [[ ${{ github.ref_name }} =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
echo "release=true" >> $GITHUB_OUTPUT
else
echo "release=false" >> $GITHUB_OUTPUT
fi
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: cytomineuliege/cbir
tags: |
type=raw,value=latest,enable=${{ steps.release.outputs.release }}
type=semver,pattern={{raw}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}