Skip to content

Commit

Permalink
Merge pull request #355 from panoratech/docker-ci
Browse files Browse the repository at this point in the history
✅ Split docker builds in multiple CI tasks
  • Loading branch information
rflihxyz authored Apr 11, 2024
2 parents 440db21 + b3bb945 commit 77924b0
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
- uses: actions/checkout@v3
- uses: isbang/[email protected]
with:
compose-file: "./docker-compose.dev.yml"
compose-file: "./docker-compose.dev.yml"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Docker Images (Selfhosted)
name: Export Docker Images (Backend Selfhosted)

on:
push:
Expand Down Expand Up @@ -27,42 +27,14 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Frontend (Magic Links)
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./apps/magic-link/Dockerfile
push: true
tags: panoradotdev/frontend-magic-links:latest
build-args: |
VITE_BACKEND_DOMAIN=${{ secrets.VITE_BACKEND_DOMAIN }}
- name: Build and push Frontend (Dashboard)
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./apps/client-ts/Dockerfile
push: true
tags: panoradotdev/frontend-webapp:latest
build-args: |
NEXT_PUBLIC_BACKEND_DOMAIN=${{ secrets.NEXT_PUBLIC_BACKEND_DOMAIN }}
NEXT_PUBLIC_MAGIC_LINK_DOMAIN=${{ secrets.NEXT_PUBLIC_MAGIC_LINK_DOMAIN }}
NEXT_PUBLIC_STYTCH_PROJECT_ID=${{ secrets.NEXT_PUBLIC_STYTCH_PROJECT_ID }}
NEXT_PUBLIC_STYTCH_SECRET=${{ secrets.NEXT_PUBLIC_STYTCH_SECRET }}
NEXT_PUBLIC_STYTCH_PROJECT_ENV=${{ secrets.NEXT_PUBLIC_STYTCH_PROJECT_ENV }}
NEXT_PUBLIC_STYTCH_PUBLIC_TOKEN=${{ secrets.NEXT_PUBLIC_STYTCH_PUBLIC_TOKEN }}
NEXT_PUBLIC_DISTRIBUTION=${{ env.DISTRIBUTION }}
- name: Build and push Backend (API)
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./packages/api/Dockerfile
push: true
tags: panoradotdev/backend-api:latest
tags: panoradotdev/backend-api:selfhosted
build-args: |
OAUTH_REDIRECT_BASE=${{ env.OAUTH_REDIRECT_BASE }}
DISTRIBUTION=${{ env.DISTRIBUTION }}
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/docker.export.frontend.selfhosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Export Docker Images (Frontend Selfhosted)

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
env:
ENVIRONMENT: SELF_HOSTED

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Frontend (Magic Links)
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./apps/magic-link/Dockerfile
push: true
tags: panoradotdev/frontend-magic-links:selfhosted
build-args: |
VITE_BACKEND_DOMAIN=${{ secrets.VITE_BACKEND_DOMAIN }}
- name: Build and push Frontend (Dashboard)
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./apps/client-ts/Dockerfile
push: true
tags: panoradotdev/frontend-webapp:selfhosted
build-args: |
NEXT_PUBLIC_BACKEND_DOMAIN=${{ secrets.NEXT_PUBLIC_BACKEND_DOMAIN }}
NEXT_PUBLIC_MAGIC_LINK_DOMAIN=${{ secrets.NEXT_PUBLIC_MAGIC_LINK_DOMAIN }}
NEXT_PUBLIC_STYTCH_PROJECT_ID=${{ secrets.NEXT_PUBLIC_STYTCH_PROJECT_ID }}
NEXT_PUBLIC_STYTCH_SECRET=${{ secrets.NEXT_PUBLIC_STYTCH_SECRET }}
NEXT_PUBLIC_STYTCH_PROJECT_ENV=${{ secrets.NEXT_PUBLIC_STYTCH_PROJECT_ENV }}
NEXT_PUBLIC_STYTCH_PUBLIC_TOKEN=${{ secrets.NEXT_PUBLIC_STYTCH_PUBLIC_TOKEN }}
NEXT_PUBLIC_DISTRIBUTION=${{ env.DISTRIBUTION }}
38 changes: 0 additions & 38 deletions .vaunt/config.yaml

This file was deleted.

0 comments on commit 77924b0

Please sign in to comment.