From 2faa9222d888aa19b29b45c431603ffc6cefa161 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Thu, 19 Oct 2023 16:05:41 +0100 Subject: [PATCH] update gamma gh action --- .github/workflows/build-staging-img.yml | 71 +++++-------------------- 1 file changed, 12 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build-staging-img.yml b/.github/workflows/build-staging-img.yml index f4233c713..6e094871e 100644 --- a/.github/workflows/build-staging-img.yml +++ b/.github/workflows/build-staging-img.yml @@ -2,7 +2,7 @@ name: Build, Publish and Deploy to Gamma on: [workflow_dispatch] jobs: - backend-image: + infisical-image: name: Build backend image runs-on: ubuntu-latest steps: @@ -32,8 +32,9 @@ jobs: project: 64mmf0n610 token: ${{ secrets.DEPOT_PROJECT_TOKEN }} load: true - context: backend - tags: infisical/backend:test + context: . + file: Dockerfile.standalone-infisical + tags: infisical/infisical:test - name: โป Spawn backend container and dependencies run: | docker compose -f .github/resources/docker-compose.be-test.yml up --wait --quiet-pull @@ -49,68 +50,20 @@ jobs: project: 64mmf0n610 token: ${{ secrets.DEPOT_PROJECT_TOKEN }} push: true - context: backend + context: . + file: Dockerfile.standalone-infisical tags: | - infisical/staging_deployment_backend:${{ steps.commit.outputs.short }} - infisical/staging_deployment_backend:latest + infisical/staging_infisical:${{ steps.commit.outputs.short }} + infisical/staging_infisical:latest platforms: linux/amd64,linux/arm64 + build-args: | + POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }} + INFISICAL_PLATFORM_VERSION=${{ steps.extract_version.outputs.version }} - frontend-image: - name: Build frontend image - runs-on: ubuntu-latest - steps: - - name: โ˜๏ธ Checkout source - uses: actions/checkout@v3 - - name: Save commit hashes for tag - id: commit - uses: pr-mpt/actions-commit-hash@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: Set up Depot CLI - uses: depot/setup-action@v1 - - name: ๐Ÿ“ฆ Build frontend and export to Docker - uses: depot/build-push-action@v1 - with: - load: true - token: ${{ secrets.DEPOT_PROJECT_TOKEN }} - project: 64mmf0n610 - context: frontend - tags: infisical/staging_deployment_frontend:test - build-args: | - POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }} - NEXT_INFISICAL_PLATFORM_VERSION=${{ steps.extract_version.outputs.version }} - - name: โป Spawn frontend container - run: | - docker run -d --rm --name infisical-frontend-test infisical/staging_deployment_frontend:test - - name: ๐Ÿงช Test frontend image - run: | - ./.github/resources/healthcheck.sh infisical-frontend-test - - name: โป Shut down frontend container - run: | - docker stop infisical-frontend-test - - name: ๐Ÿ—๏ธ Build frontend and push - uses: depot/build-push-action@v1 - with: - project: 64mmf0n610 - push: true - token: ${{ secrets.DEPOT_PROJECT_TOKEN }} - context: frontend - tags: | - infisical/staging_deployment_frontend:${{ steps.commit.outputs.short }} - infisical/staging_deployment_frontend:latest - platforms: linux/amd64,linux/arm64 - build-args: | - POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }} - NEXT_INFISICAL_PLATFORM_VERSION=${{ steps.extract_version.outputs.version }} gamma-deployment: name: Deploy to gamma runs-on: ubuntu-latest - needs: [frontend-image, backend-image] + needs: [infisical-image] steps: - name: โ˜๏ธ Checkout source uses: actions/checkout@v3