Skip to content

Publish and Build Docker Image #6

Publish and Build Docker Image

Publish and Build Docker Image #6

name: Publish and Build Docker Image
on:
release:
types: [published]
workflow_dispatch:
inputs:
TAG_NAME:
description: 'Tag name for test version'
required: true
env:
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_ACTION_USER }}
password: ${{ secrets.DOCKER_ACTION_TOKEN }}
- name: Build and push on release
if: github.event_name == 'release'
uses: docker/build-push-action@v6
with:
file: ./build_standalone/Dockerfile
context: .
push: true
tags: |
ghcr.io/rationai/wsi-service:${{ env.TAG_NAME }}
ghcr.io/rationai/wsi-service:latest
- name: Build and push on dispatch
if: github.event_name != 'release'
uses: docker/build-push-action@v6
with:
file: ./build_standalone/Dockerfile
context: .
push: true
tags: |
ghcr.io/rationai/wsi-service:${{ env.TAG_NAME }}