Skip to content

Revert "Fix thinking-block collapse and Safari layout shifts (#2426)" #1672

Revert "Fix thinking-block collapse and Safari layout shifts (#2426)"

Revert "Fix thinking-block collapse and Safari layout shifts (#2426)" #1672

Workflow file for this run

name: Build and Publish Image
permissions:
packages: write
on:
push:
branches:
- "main"
pull_request:
branches:
- "*"
paths:
- "Dockerfile"
- "entrypoint.sh"
workflow_dispatch:
release:
types: [published, edited]
jobs:
build-and-publish-image-with-db:
runs-on:
group: aws-general-8-plus
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Extract package version
id: package-version
run: |
VERSION=$(jq -r .version package.json)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
MAJOR=$(echo $VERSION | cut -d '.' -f1)
echo "MAJOR=$MAJOR" >> $GITHUB_OUTPUT
MINOR=$(echo $VERSION | cut -d '.' -f1).$(echo $VERSION | cut -d '.' -f2)
echo "MINOR=$MINOR" >> $GITHUB_OUTPUT
- name: Docker metadata
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
with:
images: |
ghcr.io/huggingface/chat-ui-db
tags: |
type=raw,value=${{ steps.package-version.outputs.VERSION }},enable=${{github.event_name == 'release'}}
type=raw,value=${{ steps.package-version.outputs.MAJOR }},enable=${{github.event_name == 'release'}}
type=raw,value=${{ steps.package-version.outputs.MINOR }},enable=${{github.event_name == 'release'}}
type=raw,value=latest,enable={{is_default_branch}}
type=sha,enable={{is_default_branch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@797d68864753cbceedc271349d402da4590e6302 # v4.5.0
- name: Build and Publish Docker Image with DB
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
with:
context: .
file: Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
INCLUDE_DB=true
PUBLIC_COMMIT_SHA=${{ env.GITHUB_SHA_SHORT }}
build-and-publish-image-nodb:
runs-on:
group: aws-general-8-plus
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Extract package version
id: package-version
run: |
VERSION=$(jq -r .version package.json)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
MAJOR=$(echo $VERSION | cut -d '.' -f1)
echo "MAJOR=$MAJOR" >> $GITHUB_OUTPUT
MINOR=$(echo $VERSION | cut -d '.' -f1).$(echo $VERSION | cut -d '.' -f2)
echo "MINOR=$MINOR" >> $GITHUB_OUTPUT
- name: Docker metadata
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
with:
images: |
ghcr.io/huggingface/chat-ui
tags: |
type=raw,value=${{ steps.package-version.outputs.VERSION }},enable=${{github.event_name == 'release'}}
type=raw,value=${{ steps.package-version.outputs.MAJOR }},enable=${{github.event_name == 'release'}}
type=raw,value=${{ steps.package-version.outputs.MINOR }},enable=${{github.event_name == 'release'}}
type=raw,value=latest,enable={{is_default_branch}}
type=sha,enable={{is_default_branch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@797d68864753cbceedc271349d402da4590e6302 # v4.5.0
- name: Build and Publish Docker Image without DB
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
with:
context: .
file: Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
INCLUDE_DB=false
PUBLIC_COMMIT_SHA=${{ env.GITHUB_SHA_SHORT }}