This commit is contained in:
Vladyslav Matsiiako
2023-01-10 14:08:12 -08:00
+17 -45
View File
@@ -13,30 +13,23 @@ jobs:
- name: Save commit hashes for tag - name: Save commit hashes for tag
id: commit id: commit
uses: pr-mpt/actions-commit-hash@v2 uses: pr-mpt/actions-commit-hash@v2
- 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 uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: backend-${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
backend-${{ runner.os }}-buildx-
- 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: Set up Depot CLI
uses: depot/setup-action@v1
- name: 📦 Build backend and export to Docker - name: 📦 Build backend and export to Docker
uses: docker/build-push-action@v3 uses: depot/build-push-action@v1
with: with:
project: 64mmf0n610
token: ${{ secrets.DEPOT_PROJECT_TOKEN }}
load: true load: true
context: backend context: backend
tags: infisical/backend:test tags: infisical/backend:test
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: ⏻ Spawn backend container and dependencies - name: ⏻ Spawn backend container and dependencies
run: | run: |
docker compose -f .github/resources/docker-compose.be-test.yml up --wait --quiet-pull docker compose -f .github/resources/docker-compose.be-test.yml up --wait --quiet-pull
@@ -47,22 +40,15 @@ jobs:
run: | run: |
docker compose -f .github/resources/docker-compose.be-test.yml down docker compose -f .github/resources/docker-compose.be-test.yml down
- name: 🏗️ Build backend and push - name: 🏗️ Build backend and push
uses: docker/build-push-action@v3 uses: depot/build-push-action@v1
with: with:
project: 64mmf0n610
token: ${{ secrets.DEPOT_PROJECT_TOKEN }}
push: true push: true
context: backend context: backend
tags: infisical/backend:${{ steps.commit.outputs.short }}, tags: infisical/backend:${{ steps.commit.outputs.short }},
infisical/backend:latest infisical/backend:latest
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
frontend-image: frontend-image:
name: Build frontend image name: Build frontend image
@@ -74,30 +60,23 @@ jobs:
- name: Save commit hashes for tag - name: Save commit hashes for tag
id: commit id: commit
uses: pr-mpt/actions-commit-hash@v2 uses: pr-mpt/actions-commit-hash@v2
- 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 uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: frontend-${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
frontend-${{ runner.os }}-buildx-
- 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: Set up Depot CLI
uses: depot/setup-action@v1
- name: 📦 Build frontend and export to Docker - name: 📦 Build frontend and export to Docker
uses: docker/build-push-action@v3 uses: depot/build-push-action@v1
with: with:
load: true load: true
token: ${{ secrets.DEPOT_PROJECT_TOKEN }}
project: 64mmf0n610
context: frontend context: frontend
tags: infisical/frontend:test tags: infisical/frontend:test
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
build-args: | build-args: |
POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }} POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }}
- name: ⏻ Spawn frontend container - name: ⏻ Spawn frontend container
@@ -110,21 +89,14 @@ jobs:
run: | run: |
docker stop infisical-frontend-test docker stop infisical-frontend-test
- name: 🏗️ Build frontend and push - name: 🏗️ Build frontend and push
uses: docker/build-push-action@v3 uses: depot/build-push-action@v1
with: with:
project: 64mmf0n610
push: true push: true
token: ${{ secrets.DEPOT_PROJECT_TOKEN }}
context: frontend context: frontend
tags: infisical/frontend:${{ steps.commit.outputs.short }}, tags: infisical/frontend:${{ steps.commit.outputs.short }},
infisical/frontend:latest infisical/frontend:latest
platforms: linux/amd64,linux/arm64 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: | build-args: |
POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }} POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }}
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache