Skip to content

Core Linux Helpers

Core Linux Helpers #1

name: Core Linux Helpers
on:
workflow_dispatch:
inputs:
flavors:
description: "List of flavors to build"
default: '["x86", "x86_64", "arm", "arm64", "mips", "mipsel", "mips64", "mips64el"]'
env:
REGISTRY: ghcr.io
jobs:
build-base:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and cache base image
uses: docker/build-push-action@v5
with:
context: core-linux-helpers
file: core-linux-helpers/Dockerfile
target: base
push: false
load: true
tags: base:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and cache android image
uses: docker/build-push-action@v5
with:
context: core-linux-helpers
file: core-linux-helpers/Dockerfile
target: android
push: false
load: true
tags: android:latest
cache-from: type=gha
cache-to: type=gha,mode=max
core-linux-helpers:
needs: build-base
runs-on: ubuntu-latest
strategy:
matrix:
flavor: ${{ fromJSON(github.event.inputs.flavors) }}
fail-fast: false
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/core-linux-helpers-${{ matrix.flavor }}
tags: type=raw,value=latest,enable={{ is_default_branch }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: core-linux-helpers
file: core-linux-helpers/Dockerfile
target: ${{ matrix.flavor }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max