Skip to content

ci

ci #112

name: ci
on:
workflow_dispatch:
release:
types:
- published
env:
DOCKER_IMAGE_NAME: voltrondata/flight-sql
jobs:
build-project:
name: Build Project
strategy:
matrix:
include:
- platform: amd64
os: linux
runner: buildjet-8vcpu-ubuntu-2204
- platform: arm64
os: linux
runner: buildjet-8vcpu-ubuntu-2204-arm
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install build requirements
run: |
sudo apt-get update && \
sudo apt-get install -y \
build-essential \
ninja-build \
cmake \
gcc \
git \
libboost-all-dev && \
sudo apt-get clean && \
sudo rm -rf /var/lib/apt/lists/*
- name: Configure Project
uses: threeal/[email protected]
with:
generator: Ninja
run-build: true
- name: Zip artifacts
run: |
zip -j flight_sql.zip build/flight_sql
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: flight_sql_cli_${{ matrix.os }}_${{ matrix.platform }}.zip
path: |
flight_sql.zip
- 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_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/${{ matrix.platform }}
file: Dockerfile.ci
push: true
tags: |
${{ env.DOCKER_IMAGE_NAME }}:latest-${{ matrix.platform }}
${{ env.DOCKER_IMAGE_NAME }}:${{ github.ref_name }}-${{ matrix.platform }}
no-cache: true
provenance: false
build-args: |
GITHUB_WORKSPACE=${{ github.workspace }}
update-image-manifest:
name: Update DockerHub image manifest to include all built platforms
needs: build-project
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Create and push manifest images
uses: Noelware/docker-manifest-action@master # or use a pinned version in the Releases tab
with:
inputs: ${{ env.DOCKER_IMAGE_NAME }}:latest,${{ env.DOCKER_IMAGE_NAME }}:${{ github.ref_name }}
images: ${{ env.DOCKER_IMAGE_NAME }}:latest-amd64,${{ env.DOCKER_IMAGE_NAME }}:latest-arm64
push: true