Bump up the version #210
Workflow file for this run
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: Docker Images CI | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
REGISTRY: ghcr.io | |
ORG: trypromptly | |
IMAGE_NAME_API: "llmstack-api" | |
IMAGE_NAME_APP: "llmstack-app" | |
jobs: | |
build: | |
runs-on: large-runner | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Install the cosign tool except on PR | |
# https://github.com/sigstore/cosign-installer | |
- name: Install cosign | |
if: github.event_name != 'pull_request' | |
uses: sigstore/[email protected] | |
with: | |
cosign-release: "v2.2.4" | |
# Setup QEMU for cross compilation | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
# Setup Docker Buildx | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# Login against a Docker registry except on PR | |
# https://github.com/docker/login-action | |
- name: Log into registry ${{ env.REGISTRY }} | |
if: github.event_name != 'pull_request' | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Extract metadata (tags, labels) for Docker | |
# https://github.com/docker/metadata-action | |
- name: Extract Docker metadata for API | |
id: meta-api | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE_NAME_API }} | |
- name: Extract Docker metadata for app | |
id: meta-app | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE_NAME_APP }} | |
# Build client | |
- name: Build client | |
run: | | |
cd llmstack/client | |
npm install | |
REACT_APP_GA_MEASUREMENT_IDS=G-XZ40100Y5C npm run build | |
rm -rf node_modules | |
cd ../../ | |
# Build and push Docker image with Buildx (don't push on PR) | |
# https://github.com/docker/build-push-action | |
- name: Build and push LLMStack API Docker image | |
id: build-and-push-api | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta-api.outputs.tags }} | |
labels: ${{ steps.meta-api.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
file: docker/api/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
- name: Sign the published LLMStack API Docker image | |
if: ${{ github.event_name != 'pull_request' }} | |
env: | |
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable | |
TAGS: ${{ steps.meta-api.outputs.tags }} | |
DIGEST: ${{ steps.build-and-push-api.outputs.digest }} | |
# This step uses the identity token to provision an ephemeral certificate | |
# against the sigstore community Fulcio instance. | |
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} | |
- name: Build and push LLMStack app Docker image | |
id: build-and-push-app | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta-app.outputs.tags }} | |
labels: ${{ steps.meta-app.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
file: docker/app/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
REGISTRY=${{ env.REGISTRY }}/${{ env.ORG }}/ | |
TAG=latest | |
- name: Sign the published LLMStack app Docker image | |
if: ${{ github.event_name != 'pull_request' }} | |
env: | |
TAGS: ${{ steps.meta-app.outputs.tags }} | |
DIGEST: ${{ steps.build-and-push-app.outputs.digest }} | |
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} |