diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cf7fde76f..c318da91e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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}} diff --git a/.github/workflows/docker_prime.yml b/.github/workflows/docker_prime.yml index 06dd5be8c..537345e08 100644 --- a/.github/workflows/docker_prime.yml +++ b/.github/workflows/docker_prime.yml @@ -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)}}