mirror of
https://github.com/falcosecurity/falco.git
synced 2025-10-21 19:44:57 +00:00
75 lines
3.1 KiB
YAML
75 lines
3.1 KiB
YAML
# This is a reusable workflow used by master and release CI
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
arch:
|
|
description: x86_64 or aarch64
|
|
required: true
|
|
type: string
|
|
bucket_suffix:
|
|
description: bucket suffix for packages
|
|
required: false
|
|
default: ''
|
|
type: string
|
|
version:
|
|
description: The Falco version to use when building images
|
|
required: true
|
|
type: string
|
|
tag:
|
|
description: The tag to use (e.g. "master" or "0.35.0")
|
|
required: true
|
|
type: string
|
|
|
|
# Here we just build all docker images as tarballs,
|
|
# then we upload all the tarballs to be later downloaded by reusable_publish_docker workflow.
|
|
# In this way, we don't need to publish any arch specific image,
|
|
# and this "build" workflow is actually only building images.
|
|
jobs:
|
|
build-docker:
|
|
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
|
|
runs-on: ${{ (inputs.arch == 'aarch64' && fromJSON('[ "self-hosted", "linux", "ARM64" ]')) || 'ubuntu-latest' }}
|
|
env:
|
|
TARGETARCH: ${{ (inputs.arch == 'aarch64' && 'arm64') || 'amd64' }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Build no-driver image
|
|
run: |
|
|
cd ${{ github.workspace }}/docker/no-driver/
|
|
docker build -t docker.io/falcosecurity/falco-no-driver:${{ inputs.arch }}-${{ inputs.tag }} \
|
|
--build-arg VERSION_BUCKET=bin${{ inputs.bucket_suffix }} \
|
|
--build-arg FALCO_VERSION=${{ inputs.version }} \
|
|
--build-arg TARGETARCH=${TARGETARCH} \
|
|
.
|
|
docker save docker.io/falcosecurity/falco-no-driver:${{ inputs.arch }}-${{ inputs.tag }} --output /tmp/falco-no-driver-${{ inputs.arch }}.tar
|
|
|
|
- name: Build falco image
|
|
run: |
|
|
cd ${{ github.workspace }}/docker/falco/
|
|
docker build -t docker.io/falcosecurity/falco:${{ inputs.arch }}-${{ inputs.tag }} \
|
|
--build-arg VERSION_BUCKET=deb${{ inputs.bucket_suffix }} \
|
|
--build-arg FALCO_VERSION=${{ inputs.version }} \
|
|
--build-arg TARGETARCH=${TARGETARCH} \
|
|
.
|
|
docker save docker.io/falcosecurity/falco:${{ inputs.arch }}-${{ inputs.tag }} --output /tmp/falco-${{ inputs.arch }}.tar
|
|
|
|
- name: Build falco-driver-loader image
|
|
run: |
|
|
cd ${{ github.workspace }}/docker/driver-loader/
|
|
docker build -t docker.io/falcosecurity/falco-driver-loader:${{ inputs.arch }}-${{ inputs.tag }} \
|
|
--build-arg FALCO_IMAGE_TAG=${{ inputs.arch }}-${{ inputs.tag }} \
|
|
--build-arg TARGETARCH=${TARGETARCH} \
|
|
.
|
|
docker save docker.io/falcosecurity/falco-driver-loader:${{ inputs.arch }}-${{ inputs.tag }} --output /tmp/falco-driver-loader-${{ inputs.arch }}.tar
|
|
|
|
- name: Upload images tarballs
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: falco-images
|
|
path: /tmp/falco-*.tar
|
|
retention-days: 1
|