Merge branch 'stackblitz-labs:main' into main

This commit is contained in:
KevIsDev 2025-02-25 15:07:08 +00:00 committed by GitHub
commit 002f1bc5dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 50 deletions

View File

@ -1,14 +1,11 @@
---
name: Docker Publish name: Docker Publish
on: on:
workflow_dispatch:
push: push:
branches: branches:
- main - main
tags: - stable
- v* workflow_dispatch:
- '*'
permissions: permissions:
packages: write packages: write
@ -16,66 +13,49 @@ permissions:
env: env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
DOCKER_IMAGE: ghcr.io/${{ github.repository }} IMAGE_NAME: ${{ github.repository }}
BUILD_TARGET: bolt-ai-production # bolt-ai-development
jobs: jobs:
docker-build-publish: docker-build-publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- id: string
uses: ASzc/change-string-case-action@v6
with:
string: ${{ env.DOCKER_IMAGE }}
- name: Docker meta
id: meta
uses: crazy-max/ghaction-docker-meta@v5
with:
images: ${{ steps.string.outputs.lowercase }}
flavor: |
latest=true
prefix=
suffix=
tags: |
type=semver,pattern={{version}}
type=pep440,pattern={{version}}
type=ref,event=tag
type=raw,value={{sha}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Login to Container Registry - name: Log in to GitHub Container Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
username: ${{ github.actor }} # ${{ secrets.DOCKER_USERNAME }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} # ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push - name: Extract metadata for Docker image
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image for main
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: . context: .
file: ./Dockerfile
target: ${{ env.BUILD_TARGET }}
platforms: linux/amd64,linux/arm64
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ steps.string.outputs.lowercase }}:latest
cache-to: type=inline
- name: Check manifest - name: Build and push Docker image for stable
run: | if: github.ref == 'refs/heads/stable'
docker buildx imagetools inspect ${{ steps.string.outputs.lowercase }}:${{ steps.meta.outputs.version }} uses: docker/build-push-action@v6
with:
- name: Dump context context: .
if: always() push: true
uses: crazy-max/ghaction-dump-context@v2 tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:stable
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -6,9 +6,10 @@ WORKDIR /app
# Install dependencies (this step is cached as long as the dependencies don't change) # Install dependencies (this step is cached as long as the dependencies don't change)
COPY package.json pnpm-lock.yaml ./ COPY package.json pnpm-lock.yaml ./
RUN npm install -g corepack@latest #RUN npm install -g corepack@latest
RUN corepack enable pnpm && pnpm install #RUN corepack enable pnpm && pnpm install
RUN npm install -g pnpm && pnpm install
# Copy the rest of your app's source code # Copy the rest of your app's source code
COPY . . COPY . .