-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3aced9
commit 4d49549
Showing
3 changed files
with
118 additions
and
35 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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
on: | ||
push: | ||
branches: ["release"] | ||
pull_request: | ||
branches: ["release"] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
attestations: write | ||
id-token: write | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'release') }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push renderer | ||
id: push-renderer | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./renderer/dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Build and push web-app | ||
id: push-web | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./web/dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Generate artifact attestation for renderer | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}-renderer | ||
subject-digest: ${{ steps.push-renderer.outputs.digest }} | ||
push-to-registry: true | ||
|
||
- name: Generate artifact attestation for web-app | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}-web | ||
subject-digest: ${{ steps.push-web.outputs.digest }} | ||
push-to-registry: true |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: sparkles | ||
|
||
services: | ||
web: | ||
image: web-ui | ||
env_file: | ||
- .env | ||
build: | ||
context: ./web | ||
dockerfile: dockerfile | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
- RENDERER_URL=http://renderer:3001 | ||
- NEXT_PUBLIC_BASE_URL=http://web:3000 | ||
- GROQ_API_KEY=${GROQ_API_KEY} | ||
- GEMINI_API_KEY=${GEMINI_API_KEY} | ||
- GOOGLE_API_KEY=${GOOGLE_API_KEY} | ||
- CF_API_KEY=${CF_API_KEY} | ||
- R2_ACCESS_KEY=${R2_ACCESS_KEY} | ||
- R2_SECRET_KEY=${R2_SECRET_KEY} | ||
- CF_ACCOUNT_ID=${CF_ACCOUNT_ID} | ||
- BUCKET_NAME=${BUCKET_NAME} | ||
- ASSEMBLY_API_KEY=${ASSEMBLY_API_KEY} | ||
- REPLICATE_API_KEY=${REPLICATE_API_KEY} | ||
- D1_ID=${D1_ID} | ||
- D1_KEY=${D1_KEY} | ||
- CF_ID=${CF_ID} | ||
|
||
renderer: | ||
image: ai-short-gen-renderer | ||
build: | ||
context: ./renderer | ||
ports: | ||
- "3001:3001" | ||
|
||
networks: | ||
default: | ||
name: app-network |
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