ci(fix): Set ui image builds to no-cache #435
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: Publish Images | |
on: | |
push: | |
branches: | |
- "main" | |
tags: | |
- "*.*.*" | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
push-api-to-ghcr: | |
runs-on: ubuntu-latest | |
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: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/tracecathq/tracecat | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
${{ steps.meta.outputs.tags }} | |
${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && 'ghcr.io/tracecathq/tracecat:latest' || '' }} | |
labels: ${{ steps.meta.outputs.labels }} | |
push-ui-to-ghcr: | |
runs-on: ubuntu-latest | |
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: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/tracecathq/tracecat-ui | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Build and push Docker image | |
# NOTE: this image is used for local deployment (no Clerk) | |
uses: docker/build-push-action@v6 | |
env: | |
NEXT_PUBLIC_API_URL: http://localhost:8000 | |
NEXT_PUBLIC_APP_ENV: production | |
NEXT_PUBLIC_APP_URL: http://localhost:3000 | |
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: "secret-clerk-publishable-key" | |
NEXT_PUBLIC_DISABLE_AUTH: "true" # Disable Clerk | |
NEXT_SERVER_API_URL: http://localhost:8000 | |
NODE_ENV: production | |
with: | |
context: frontend | |
file: frontend/Dockerfile.prod | |
build-args: | | |
NEXT_PUBLIC_API_URL=${{ env.NEXT_PUBLIC_API_URL }} | |
NEXT_PUBLIC_APP_ENV=${{ env.NEXT_PUBLIC_APP_ENV }} | |
NEXT_PUBLIC_APP_URL=${{ env.NEXT_PUBLIC_APP_URL }} | |
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=${{ env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }} | |
NEXT_PUBLIC_DISABLE_AUTH=${{ env.NEXT_PUBLIC_DISABLE_AUTH }} | |
NEXT_SERVER_API_URL=${{ env.NEXT_SERVER_API_URL }} | |
NODE_ENV=${{ env.NODE_ENV }} | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ steps.meta.outputs.tags }} | |
${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && 'ghcr.io/tracecathq/tracecat-ui:latest' || '' }} | |
labels: ${{ steps.meta.outputs.labels }} | |
no-cache: true | |
push-cli-to-ghcr: | |
runs-on: ubuntu-latest | |
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: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/tracecathq/tracecat-cli | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: Dockerfile.cli | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
${{ steps.meta.outputs.tags }} | |
${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && 'ghcr.io/tracecathq/tracecat-cli:latest' || '' }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Verify Docker CLI commands | |
run: | | |
docker run --rm ghcr.io/tracecathq/tracecat-cli | |
docker run --rm ghcr.io/tracecathq/tracecat-cli --version |