Skip to content

v1.4.2

v1.4.2 #13

Workflow file for this run

name: Docker Hub Release
# This workflow automates the process of building and publishing a Docker image.
# It triggers on a published release, which builds and pushes the image to Docker Hub.
# The Docker image is tagged with the release version from the GitHub tag.
on:
release:
types: [published]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- 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.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
run: |
VERSION=${GITHUB_REF#refs/tags/}
IMAGE_BASE=${{ secrets.DOCKERHUB_USERNAME }}/unicorn_baseline
# Build the image
docker build -t $IMAGE_BASE:$VERSION -t $IMAGE_BASE:latest .
# Push both tags
docker push $IMAGE_BASE:$VERSION
docker push $IMAGE_BASE:latest