This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
Remove JINA API key from mandatory env vars (#303) #73
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create and publish a Docker image | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to tag the image with' | |
required: true | |
type: string | |
workflow_call: | |
inputs: | |
version: | |
description: 'Version to tag the image with' | |
required: true | |
type: string | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v*' | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }} | |
tags: | | |
type=ref,event=branch,enable=${{ github.event_name == 'push' }} | |
type=semver,pattern={{version}},enable=${{ github.event_name == 'push' }} | |
type=raw,value=latest,enable=${{ github.event_name != 'push' }} | |
type=raw,value=${{inputs.version}},enable=${{ github.event_name != 'push' }} | |
- name: Create build args | |
run: | | |
export POETRY_INSTALL_ARGS="$(make print-var VAR=POETRY_DEFAULT_EXTRAS)" | |
echo "POETRY_INSTALL_ARGS=$POETRY_INSTALL_ARGS" >> $GITHUB_OUTPUT | |
id: build-args | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64 | |
push: true | |
build-args: | | |
POETRY_INSTALL_ARGS=${{steps.build-args.outputs.POETRY_INSTALL_ARGS}} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
provenance: false | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |