Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Improve GH Action workflow for building images

Reginald Bondoca83d536ea42d
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
index 770fa7e836..dbb9957cbc 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:
- push: true
+ load: true
context: backend
tags: infisical/backend:test
-
- name: Build and push frontend
+ 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
- file: frontend/Dockerfile.dev
+ context: backend
+ 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: 🔧 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
+ context: frontend
+ tags: infisical/frontend:latest
+ platforms: linux/amd64,linux/arm64
diff --git a/docker-compose.yml b/docker-compose.yml
index c719464aeb..cc92e14063 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 be12ba4188..44ee4fdb39 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 4de6ab5ce8..92bdc078e1 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";