Skip to content

Publish image: chainlit_bot 0.01 #5

Publish image: chainlit_bot 0.01

Publish image: chainlit_bot 0.01 #5

Workflow file for this run

name: "Build and publish Docker image"
run-name: "Publish image: ${{inputs.image_name}} ${{inputs.image_tag}}"
# SecRel will not sign images outside the scope of the repository that's calling SecRel,
# so the image must exist in abd-vro-internal for SecRel to sign the images (required for sandbox and prod environments).
# Run this in action in both abd-vro and abd-vro-internal repos.
on:
workflow_dispatch:
inputs:
dockerfile_folder:
description: 'Folder containing Dockerfile to build'
required: true
type: string
default: '02-household-queries'
image_name:
description: 'Name of the image to push'
required: true
type: string
default: 'chainlit_bot'
image_tag:
description: 'Tag/Version of the image to push'
required: true
type: string
default: '0.01'
env:
# Add prefix to be clear that we're not using the original image
TARGET_IMAGE: "${{ inputs.image_name }}"
# Target path where the image will be pushed, i.e., to GHCR for the current repo
GHCR_PATH: "ghcr.io/${{ github.repository }}/${{ inputs.image_name }}"
jobs:
publish-image:
runs-on: ubuntu-latest
steps:
- name: "Checkout source code"
uses: actions/checkout@v4
- name: "Login to GitHub Container Registry"
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Publish images using tags '${{ inputs.image_tag }}'"
id: docker-push
shell: bash
run: |
ls
cd ${{ inputs.dockerfile_folder }}
docker build -t "${{ inputs.image_name }}:${{ inputs.image_tag }}" .
echo "# Publishing image ${{ inputs.image_name }}:${{ inputs.image_tag }} to ${{ env.GHCR_PATH }}"
docker tag "${{ inputs.image_name }}:${{ inputs.image_tag }}" "${{ env.GHCR_PATH }}:${{ inputs.image_tag }}"
docker push "${{ env.GHCR_PATH }}:${{ inputs.image_tag }}"