mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 09:28:06 +00:00
Improve GH Action workflow for building images
This commit is contained in:
@@ -3,35 +3,86 @@ name: Push to Docker Hub
|
|||||||
on: [workflow_dispatch]
|
on: [workflow_dispatch]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
|
||||||
|
backend-image:
|
||||||
|
name: Build backend image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
-
|
||||||
|
name: ☁️ Checkout source
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: 🔧 Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: 🔧 Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
-
|
-
|
||||||
name: Login to Docker Hub
|
name: 🐋 Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
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
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
context: backend
|
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
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
file: frontend/Dockerfile.dev
|
|
||||||
context: frontend
|
context: frontend
|
||||||
tags: infisical/frontend:test
|
tags: infisical/frontend:latest
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ services:
|
|||||||
- infisical
|
- infisical
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
platform: linux/amd64
|
|
||||||
container_name: infisical-backend
|
container_name: infisical-backend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -31,7 +30,6 @@ services:
|
|||||||
- infisical
|
- infisical
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
platform: linux/amd64
|
|
||||||
container_name: infisical-frontend
|
container_name: infisical-frontend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
|
|
||||||
export const initPostHog = () => {
|
export const initPostHog = () => {
|
||||||
if (typeof window !== "undefined") {
|
if (typeof window !== "undefined") {
|
||||||
if (ENV == "production" && TELEMETRY_CAPTURING_ENABLED) {
|
if (ENV == "production" && TELEMETRY_CAPTURING_ENABLED) { // eslint-disable-line
|
||||||
posthog.init(POSTHOG_API_KEY, {
|
posthog.init(POSTHOG_API_KEY, {
|
||||||
api_host: POSTHOG_HOST,
|
api_host: POSTHOG_HOST,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable */
|
||||||
import { initPostHog } from "~/components/analytics/posthog";
|
import { initPostHog } from "~/components/analytics/posthog";
|
||||||
import { ENV } from "~/components/utilities/config";
|
import { ENV } from "~/components/utilities/config";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user