mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-11 00:05:36 +02:00
87 lines
3.2 KiB
YAML
87 lines
3.2 KiB
YAML
name: Build Nestri runner image variants
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: 7 0 * * 1,3,6 # Nightlies
|
|
push:
|
|
branches: [ dev, production ]
|
|
paths:
|
|
- "containerfiles/*runner.Containerfile"
|
|
- ".github/workflows/runner-variants.yml"
|
|
- "packages/scripts/**"
|
|
- "packages/configs/**"
|
|
tags:
|
|
- v*.*.*
|
|
release:
|
|
types: [ created ]
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: nestrilabs/nestri
|
|
|
|
jobs:
|
|
bases:
|
|
uses: ./.github/workflows/runner-bases.yml
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
build-and-push-variants:
|
|
needs: [ bases ]
|
|
name: Build and push images
|
|
if: ${{ github.ref == 'refs/heads/production' || github.ref == 'refs/heads/dev' }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
strategy:
|
|
matrix:
|
|
variant:
|
|
- { suffix: "v2", base: "docker.io/cachyos/cachyos:latest" }
|
|
- { suffix: "v3", base: "docker.io/cachyos/cachyos-v3:latest" }
|
|
#- { suffix: "v4", base: "docker.io/cachyos/cachyos-v4:latest" } # Disabled until GHA has this
|
|
runner:
|
|
- steam
|
|
- heroic
|
|
- minecraft
|
|
# ADD MORE HERE AS NEEDED #
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4
|
|
- name: Log into registry ${{ env.REGISTRY }}
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ github.token }}
|
|
- name: Extract runner metadata
|
|
id: meta-runner
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/runner
|
|
tags: |
|
|
type=raw,value=nightly-${{ matrix.runner }}-${{ matrix.variant.suffix }},enable={{is_default_branch}}
|
|
type=raw,value={{branch}}-${{ matrix.runner }}-${{ matrix.variant.suffix }}
|
|
type=raw,value=latest-${{ matrix.runner }}-${{ matrix.variant.suffix }},enable=${{ github.ref == format('refs/heads/{0}', 'production') }}
|
|
type=semver,pattern={{version}}-${{ matrix.runner }}-${{ matrix.variant.suffix }}
|
|
type=semver,pattern={{major}}.{{minor}}-${{ matrix.runner }}-${{ matrix.variant.suffix }}
|
|
type=semver,pattern={{major}}-${{ matrix.runner }}-${{ matrix.variant.suffix }}
|
|
- name: Setup Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Set Swap Space
|
|
uses: pierotofy/set-swap-space@master
|
|
with:
|
|
swap-size-gb: 20
|
|
- name: Build and push runner image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
file: containerfiles/${{ matrix.runner }}-runner.Containerfile
|
|
context: ./
|
|
push: true
|
|
tags: ${{ steps.meta-runner.outputs.tags }}
|
|
labels: ${{ steps.meta-runner.outputs.labels }}
|
|
build-args: |
|
|
RUNNER_COMMON_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/runner-common:latest-${{ matrix.variant.suffix }}
|
|
cache-from: type=gha,scope=runner-${{ matrix.runner }}-${{ matrix.variant.suffix }},mode=max
|
|
cache-to: type=gha,scope=runner-${{ matrix.runner }}-${{ matrix.variant.suffix }},mode=max
|