github/workflows/docker: Tweak concurrency group; prime images fail fast; comments/cleanup.

This commit is contained in:
Jason Volk 2023-04-16 13:41:50 -07:00
parent 79f5e4fd8d
commit cab2b4c822
2 changed files with 27 additions and 9 deletions

View File

@ -1,9 +1,8 @@
#
# Build docker images
#
name: Docker Images
env:
ctor_id: ${{ vars.DOCKER_ID }}
ctor_url: https://github.com/${{github.repository}}
on:
push:
branches: [master]
@ -15,7 +14,12 @@ concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
ctor_id: ${{ vars.DOCKER_ID }}
ctor_url: https://github.com/${{github.repository}}
jobs:
# Build the base-feature intermediate images (cached and not shipped).
base:
uses: ./.github/workflows/docker_prime.yml
with:
@ -26,6 +30,7 @@ jobs:
machines: ${{vars.DOCKER_MACHINES}}
test: ${{contains(github.events.push.commits[0].message, '[ci test]')}}
# Build the full-feature intermediate images (cached and not shipped).
full:
uses: ./.github/workflows/docker_prime.yml
needs: [base]
@ -37,6 +42,7 @@ jobs:
machines: ${{vars.DOCKER_MACHINES}}
test: ${{contains(github.events.push.commits[0].message, '[ci test]')}}
# Build the leaf images (shipped and not cached)
built:
needs: [base, full]
runs-on: ${{matrix.machine}}

View File

@ -1,3 +1,9 @@
#
# Build intermediate images
#
# Called to build lower-layer images which other images depend on. These are
# cached for use by the next layer but not shipped to users.
#
name: Docker Images Prime
on:
@ -5,32 +11,38 @@ on:
inputs:
id:
type: string
description: Dockerhub acct/repo identity.
url:
type: string
description: Git repository for checkout.
features:
type: string
description: JSON array of feature-set names to build images for.
distros:
type: string
description: JSON array of operating system distros to build for.
machines:
type: string
description: JSON array of machines to build for.
test:
type: boolean
default: false
required: false
description: Echo all docker commands rather than invoking them.
concurrency:
group: ${{github.workflow}}-${{inputs.features}}
cancel-in-progress: false
env:
ctor_id: ${{inputs.id}}
ctor_url: ${{inputs.url}}
concurrency:
group: ${{github.run_id}}
cancel-in-progress: true
jobs:
prime:
runs-on: ${{matrix.machine}}
strategy:
fail-fast: false
fail-fast: true
matrix:
feature: ${{fromJSON(inputs.features)}}
distro: ${{fromJSON(inputs.distros)}}