-
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 ac281d0
Showing
3 changed files
with
137 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,96 @@ | ||
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 repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- 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: Generate metadata for renderer | ||
id: meta-renderer | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-renderer | ||
tags: type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'release') }} | ||
|
||
- name: Generate metadata for web-app | ||
id: meta-web | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-web | ||
tags: type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'release') }} | ||
|
||
- name: Build and push renderer | ||
id: push-renderer | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./renderer | ||
file: ./renderer/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta-renderer.outputs.tags }} | ||
labels: ${{ steps.meta-renderer.outputs.labels }} | ||
|
||
- name: Build and push web-app | ||
id: push-web | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./web | ||
file: ./web/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta-web.outputs.tags }} | ||
labels: ${{ steps.meta-web.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 | ||
|
||
- name: Create GitHub Release | ||
if: success() | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ github.ref_name }} | ||
name: "${{ github.ref_name }}" | ||
body: "Automated release of images for `${{ github.ref_name }}`" | ||
draft: false | ||
prerelease: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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