-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(ci): consolidate ci, make db migrations dependent on ecr success, remove turbopack for staging/prod builds #1449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4f00c1d
Remove turbopack
Sg312 7a29d93
Fix ci errors
Sg312 c185902
Sim agent import fix
Sg312 2e5708b
Lint
Sg312 b5de811
Ci orchestration
Sg312 b78048a
Lint
Sg312 b6f5d66
Ci updates
Sg312 ff450d8
Tdz fix for generate
Sg312 724fca2
Remove logger
Sg312 49919b5
Fix imports
Sg312 257bad7
Lint
Sg312 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| name: Build GHCR Images (Build Only) | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| jobs: | ||
| build: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| # AMD64 builds on x86 runners | ||
| - dockerfile: ./docker/app.Dockerfile | ||
| image: ghcr.io/simstudioai/simstudio | ||
| platform: linux/amd64 | ||
| arch: amd64 | ||
| runner: linux-x64-8-core | ||
| - dockerfile: ./docker/db.Dockerfile | ||
| image: ghcr.io/simstudioai/migrations | ||
| platform: linux/amd64 | ||
| arch: amd64 | ||
| runner: linux-x64-8-core | ||
| - dockerfile: ./docker/realtime.Dockerfile | ||
| image: ghcr.io/simstudioai/realtime | ||
| platform: linux/amd64 | ||
| arch: amd64 | ||
| runner: linux-x64-8-core | ||
| # ARM64 builds on native ARM64 runners | ||
| - dockerfile: ./docker/app.Dockerfile | ||
| image: ghcr.io/simstudioai/simstudio | ||
| platform: linux/arm64 | ||
| arch: arm64 | ||
| runner: linux-arm64-8-core | ||
| - dockerfile: ./docker/db.Dockerfile | ||
| image: ghcr.io/simstudioai/migrations | ||
| platform: linux/arm64 | ||
| arch: arm64 | ||
| runner: linux-arm64-8-core | ||
| - dockerfile: ./docker/realtime.Dockerfile | ||
| image: ghcr.io/simstudioai/realtime | ||
| platform: linux/arm64 | ||
| arch: arm64 | ||
| runner: linux-arm64-8-core | ||
| runs-on: ${{ matrix.runner }} | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Extract metadata (tags, labels) for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ matrix.image }} | ||
| tags: | | ||
| type=raw,value=latest-${{ matrix.arch }},enable=${{ github.ref == 'refs/heads/main' }} | ||
| type=raw,value=staging-${{ matrix.arch }},enable=${{ github.ref == 'refs/heads/staging' }} | ||
| type=raw,value=staging-${{ github.sha }}-${{ matrix.arch }},enable=${{ github.ref == 'refs/heads/staging' }} | ||
| type=sha,format=long,suffix=-${{ matrix.arch }} | ||
|
|
||
| - name: Build Docker image (no push) | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ${{ matrix.dockerfile }} | ||
| platforms: ${{ matrix.platform }} | ||
| push: false | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| cache-from: type=gha,scope=build-v3 | ||
| cache-to: type=gha,mode=max,scope=build-v3 | ||
| provenance: false | ||
| sbom: false |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| name: Push GHCR Images | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| jobs: | ||
| push: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| # AMD64 builds | ||
| - dockerfile: ./docker/app.Dockerfile | ||
| image: ghcr.io/simstudioai/simstudio | ||
| platform: linux/amd64 | ||
| arch: amd64 | ||
| - dockerfile: ./docker/db.Dockerfile | ||
| image: ghcr.io/simstudioai/migrations | ||
| platform: linux/amd64 | ||
| arch: amd64 | ||
| - dockerfile: ./docker/realtime.Dockerfile | ||
| image: ghcr.io/simstudioai/realtime | ||
| platform: linux/amd64 | ||
| arch: amd64 | ||
| # ARM64 builds | ||
| - dockerfile: ./docker/app.Dockerfile | ||
| image: ghcr.io/simstudioai/simstudio | ||
| platform: linux/arm64 | ||
| arch: arm64 | ||
| - dockerfile: ./docker/db.Dockerfile | ||
| image: ghcr.io/simstudioai/migrations | ||
| platform: linux/arm64 | ||
| arch: arm64 | ||
| - dockerfile: ./docker/realtime.Dockerfile | ||
| image: ghcr.io/simstudioai/realtime | ||
| platform: linux/arm64 | ||
| arch: arm64 | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - 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.repository_owner }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Extract metadata (tags, labels) for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ matrix.image }} | ||
| tags: | | ||
| type=raw,value=latest-${{ matrix.arch }},enable=${{ github.ref == 'refs/heads/main' }} | ||
| type=raw,value=staging-${{ matrix.arch }},enable=${{ github.ref == 'refs/heads/staging' }} | ||
| type=raw,value=staging-${{ github.sha }}-${{ matrix.arch }},enable=${{ github.ref == 'refs/heads/staging' }} | ||
| type=sha,format=long,suffix=-${{ matrix.arch }} | ||
|
|
||
| - name: Push Docker image from cache | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ${{ matrix.dockerfile }} | ||
| platforms: ${{ matrix.platform }} | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| cache-from: type=gha,scope=build-v3 | ||
| cache-to: type=gha,mode=max,scope=build-v3 | ||
| provenance: false | ||
| sbom: false | ||
|
|
||
| create-manifests: | ||
| runs-on: ubuntu-latest | ||
| needs: push | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - image: ghcr.io/simstudioai/simstudio | ||
| - image: ghcr.io/simstudioai/migrations | ||
| - image: ghcr.io/simstudioai/realtime | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Log in to the Container registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Extract metadata for manifest | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ matrix.image }} | ||
| tags: | | ||
| type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} | ||
| type=raw,value=staging,enable=${{ github.ref == 'refs/heads/staging' }} | ||
| type=sha,format=long | ||
|
|
||
| - name: Create and push manifest | ||
| run: | | ||
| # Extract the tags from metadata (these are the final manifest tags we want) | ||
| MANIFEST_TAGS="${{ steps.meta.outputs.tags }}" | ||
|
|
||
| # Create manifest for each tag | ||
| for manifest_tag in $MANIFEST_TAGS; do | ||
| echo "Creating manifest for $manifest_tag" | ||
|
|
||
| # The architecture-specific images have -amd64 and -arm64 suffixes | ||
| amd64_image="${manifest_tag}-amd64" | ||
| arm64_image="${manifest_tag}-arm64" | ||
|
|
||
| echo "Looking for images: $amd64_image and $arm64_image" | ||
|
|
||
| # Check if both architecture images exist | ||
| if docker manifest inspect "$amd64_image" >/dev/null 2>&1 && docker manifest inspect "$arm64_image" >/dev/null 2>&1; then | ||
| echo "Both images found, creating manifest..." | ||
| docker manifest create "$manifest_tag" \ | ||
| "$amd64_image" \ | ||
| "$arm64_image" | ||
| docker manifest push "$manifest_tag" | ||
| echo "Successfully created and pushed manifest for $manifest_tag" | ||
| else | ||
| echo "Error: One or both architecture images not found" | ||
| echo "Checking AMD64 image: $amd64_image" | ||
| docker manifest inspect "$amd64_image" || echo "AMD64 image not found" | ||
| echo "Checking ARM64 image: $arm64_image" | ||
| docker manifest inspect "$arm64_image" || echo "ARM64 image not found" | ||
| exit 1 | ||
| fi | ||
| done |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ on: | |
| branches: | ||
| - main | ||
| - staging | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| deploy: | ||
|
|
||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes it reusable (can be called from ci)