70 lines
1.9 KiB
YAML
70 lines
1.9 KiB
YAML
name: Publish Builder Images
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
paths:
|
|
- 'Dockerfile.*'
|
|
- '.gitea/workflows/scripts/*.sh'
|
|
|
|
jobs:
|
|
# JOB 1: Setup & Calculate Short SHA
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set Short SHA
|
|
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
|
|
outputs:
|
|
short_sha: ${{ env.SHORT_SHA }}
|
|
|
|
# JOB 2: Build Base (Cached)
|
|
build-base:
|
|
needs: setup
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Make scripts executable
|
|
run: chmod +x .gitea/workflows/scripts/*.sh
|
|
|
|
- name: Build Base
|
|
uses: docker://quay.io/buildah/stable
|
|
env:
|
|
USERNAME: ${{ gitea.repository_owner }}
|
|
PASSWORD: ${{ secrets.ORG_ACTIONS_TOKEN }}
|
|
REGISTRY: registry.forge.northernlighthouseinteractive.com
|
|
with:
|
|
entrypoint: /bin/sh
|
|
args: .gitea/workflows/scripts/build-base.sh
|
|
|
|
# JOB 3: Build Targets (Matrix)
|
|
build-targets:
|
|
needs: [setup, build-base]
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: windows
|
|
dockerfile: Dockerfile.windows
|
|
- name: linux
|
|
dockerfile: Dockerfile.linux
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Make scripts executable
|
|
run: chmod +x .gitea/workflows/scripts/*.sh
|
|
|
|
- name: Build ${{ matrix.name }}
|
|
uses: docker://quay.io/buildah/stable
|
|
env:
|
|
USERNAME: ${{ gitea.repository_owner }}
|
|
PASSWORD: ${{ secrets.ORG_ACTIONS_TOKEN }}
|
|
REGISTRY: registry.forge.northernlighthouseinteractive.com
|
|
TAG: ${{ needs.setup.outputs.short_sha }}
|
|
with:
|
|
entrypoint: /bin/sh
|
|
# Pass the matrix variables to our generic script
|
|
args: -c "./.gitea/workflows/scripts/build-target.sh ${{ matrix.name }} ${{ matrix.dockerfile }}" |