Skip to content

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

add cache to build after test step

Maidul Islam3eb2209eb83d
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
index d8cf080459..b2cda6fe50 100644
--- a/.github/workflows/docker-image.yml
+++ b/.github/workflows/docker-image.yml
@@ -76,6 +76,13 @@ jobs:
uses: docker/setup-qemu-action@v2
- name: πŸ”§ Set up Docker Buildx
uses: docker/setup-buildx-action@v2
+ - name: Cache Docker layers
+ uses: actions/cache@v3
+ with:
+ path: /tmp/.buildx-cache
+ key: ${{ runner.os }}-buildx-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-buildx-
- name: πŸ‹ Login to Docker Hub
uses: docker/login-action@v2
with:
@@ -84,12 +91,32 @@ jobs:
- name: πŸ“¦ Build frontend and export to Docker
uses: docker/build-push-action@v3
with:
- # load: true
- push: false
+ load: true
context: frontend
tags: infisical/frontend:test
- cache-from: type=gha
- cache-to: type=gha,mode=max
+ cache-from: type=local,src=/tmp/.buildx-cache
+ cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
+ build-args: |
+ POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }}
+ - name: ⏻ Spawn frontend container
+ run: |
+ docker run -d --rm --name infisical-frontend-test infisical/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: docker/build-push-action@v3
+ with:
+ push: false
+ context: frontend
+ tags: infisical/frontend:${{ steps.commit.outputs.short }},
+ infisical/frontend:latest
+ platforms: linux/amd64,linux/arm64
+ cache-from: type=local,src=/tmp/.buildx-cache
+ cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
build-args: |
POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }}
- # Temp fix