diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 770fa7e83..dbb9957cb 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -3,35 +3,86 @@ name: Push to Docker Hub on: [workflow_dispatch] jobs: - docker: + + backend-image: + name: Build backend image runs-on: ubuntu-latest + steps: - - name: Checkout + - + name: โ˜๏ธ Checkout source uses: actions/checkout@v2 - - name: Set up QEMU + name: ๐Ÿ”ง Set up QEMU uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx + name: ๐Ÿ”ง Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Login to Docker Hub + name: ๐Ÿ‹ Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push backend + name: ๐Ÿ“ฆ Build backend and export to Docker + uses: docker/build-push-action@v3 + with: + load: true + context: backend + tags: infisical/backend:test + - + name: ๐Ÿงช Test backend image + run: | + docker run --rm infisical/backend:test + - + name: ๐Ÿ“ฆ Build backend and push uses: docker/build-push-action@v3 with: push: true context: backend - tags: infisical/backend:test + tags: infisical/backend:latest + platforms: linux/amd64,linux/arm64 + + + frontend-image: + name: Build frontend image + runs-on: ubuntu-latest + + steps: + - + name: โ˜๏ธ Checkout source + uses: actions/checkout@v2 - - name: Build and push frontend + name: ๐Ÿ”ง Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: ๐Ÿ”ง Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: ๐Ÿ‹ Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: ๐Ÿ“ฆ Build frontend and export to Docker + uses: docker/build-push-action@v3 + with: + load: true + context: frontend + tags: infisical/frontend:test + build-args: | + POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }} + - + name: ๐Ÿงช Test frontend image + run: | + docker run --rm infisical/frontend:test + - + name: ๐Ÿ“ฆ Build frontend and push uses: docker/build-push-action@v3 with: push: true - file: frontend/Dockerfile.dev context: frontend - tags: infisical/frontend:test + tags: infisical/frontend:latest + platforms: linux/amd64,linux/arm64 diff --git a/docker-compose.yml b/docker-compose.yml index c719464ae..cc92e1406 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,6 @@ services: - infisical backend: - platform: linux/amd64 container_name: infisical-backend restart: unless-stopped depends_on: @@ -31,7 +30,6 @@ services: - infisical frontend: - platform: linux/amd64 container_name: infisical-frontend restart: unless-stopped depends_on: diff --git a/frontend/components/analytics/posthog.js b/frontend/components/analytics/posthog.js index be12ba418..44ee4fdb3 100644 --- a/frontend/components/analytics/posthog.js +++ b/frontend/components/analytics/posthog.js @@ -8,7 +8,7 @@ import { export const initPostHog = () => { if (typeof window !== "undefined") { - if (ENV == "production" && TELEMETRY_CAPTURING_ENABLED) { + if (ENV == "production" && TELEMETRY_CAPTURING_ENABLED) { // eslint-disable-line posthog.init(POSTHOG_API_KEY, { api_host: POSTHOG_HOST, }); diff --git a/frontend/components/utilities/telemetry/Telemetry.js b/frontend/components/utilities/telemetry/Telemetry.js index 4de6ab5ce..92bdc078e 100644 --- a/frontend/components/utilities/telemetry/Telemetry.js +++ b/frontend/components/utilities/telemetry/Telemetry.js @@ -1,3 +1,4 @@ +/* eslint-disable */ import { initPostHog } from "~/components/analytics/posthog"; import { ENV } from "~/components/utilities/config";