Skip to content

[Infra] Introduced multi stage build for images to improve built time #5

[Infra] Introduced multi stage build for images to improve built time

[Infra] Introduced multi stage build for images to improve built time #5

Workflow file for this run

name: Build infra images
on:
pull_request:
workflow_dispatch:
jobs:
detect-changes:
uses: ./.github/workflows/detect-changes-matrix.yml
debug-the-things:
needs: detect-changes
runs-on: 'ubuntu-latest'
steps:
- run: |
echo "${{ needs.detect-changes.outputs.infra == 'true' }}"
echo "${{ needs.detect-changes.outputs.infra }}"
echo "${{ needs.detect-changes.outputs }}"
build-infra:
# runs-on: ${{ matrix.platform == 'linux/arm64' && 'macos-13' || 'ubuntu-latest' }}
runs-on: 'ubuntu-latest'
needs: detect-changes
if: ${{ needs.detect-changes.outputs.infra == 'true' }}
steps:
- name: Check out code
uses: actions/checkout@v4
# - name: Setup docker (missing on MacOS)
# if: matrix.platform == 'linux/arm64'
# uses: douglascamata/setup-docker-macos-action@v1-alpha
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_MACHINE_USER }}
password: ${{ secrets.DOCKER_MACHINE_TOKEN }}
- name: Build Builder Image
uses: docker/build-push-action@v6
with:
context: .
file: ./integrations/_infra/Dockerfile.base.builder
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/port-labs/port-ocean-base-builder:latest
- name: Build Runner Image
uses: docker/build-push-action@v6
with:
context: .
file: ./integrations/_infra/Dockerfile.base.runner
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/port-labs/port-ocean-base-runner:latest