forked from stackblitz/bolt.new
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'stackblitz-labs:stable' into stable
- Loading branch information
Showing
2 changed files
with
32 additions
and
49 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,61 @@ | ||
--- | ||
name: Docker Publish | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
- "*" | ||
- stable | ||
workflow_dispatch: | ||
|
||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
DOCKER_IMAGE: ghcr.io/${{ github.repository }} | ||
BUILD_TARGET: bolt-ai-production # bolt-ai-development | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
docker-build-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
- name: Checkout code | ||
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 | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Container Registry | ||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} # ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.GITHUB_TOKEN }} # ${{ secrets.DOCKER_PASSWORD }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata for Docker image | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push | ||
- name: Build and push Docker image for main | ||
if: github.ref == 'refs/heads/main' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
target: ${{ env.BUILD_TARGET }} | ||
platforms: linux/amd64,linux/arm64 | ||
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 }} | ||
cache-from: type=registry,ref=${{ steps.string.outputs.lowercase }}:latest | ||
cache-to: type=inline | ||
|
||
- name: Check manifest | ||
run: | | ||
docker buildx imagetools inspect ${{ steps.string.outputs.lowercase }}:${{ steps.meta.outputs.version }} | ||
- name: Dump context | ||
if: always() | ||
uses: crazy-max/ghaction-dump-context@v2 | ||
- name: Build and push Docker image for stable | ||
if: github.ref == 'refs/heads/stable' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:stable | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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