Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/docker-multistage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ on:
description: 'The build matrix'
required: true
type: string
has_refs:
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
required: true
type: string
artifact_prefix:
description: 'Unique artifact name prefix (to avoid overriding existing artifcats during parallel runs).'
required: true
type: string
flavour:
description: 'The flavour to build (Examples: base, mods, prod or work).'
required: true
Expand All @@ -27,6 +19,14 @@ on:
description: 'The previous flavour (used for downloading previous artifact).'
required: true
type: string
artifact_prefix:
description: 'Unique artifact name prefix (to avoid overriding existing artifcats during parallel runs).'
required: true
type: string
has_refs:
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
required: true
type: boolean
run_tests:
description: 'Dertermines whether we run integration tests or not.'
required: true
Expand Down Expand Up @@ -56,14 +56,14 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
if: inputs.has_refs == 0
if: !inputs.has_refs

- name: "[SETUP] Checkout repository (ref: ${{ matrix.refs }})"
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ matrix.refs }}
if: inputs.has_refs != 0
if: inputs.has_refs

- name: "[SETUP] Setup QEMU environment"
uses: docker/setup-qemu-action@v1
Expand Down
47 changes: 23 additions & 24 deletions .github/workflows/docker-multistage-configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ name: "Configure multistage docker images (multi -flavours, -versions, -architec

on:
workflow_call:

###
### Input Variables
###
inputs:
versions:
description: 'The JSON string for versions. ( list of objects: [{NAME, VERSION[], ARCH[]}] )'
required: true
type: string
refs:
description: 'The JSON string for refs. ( object: {BRANCH, NUM_LATEST_TAGS} )'
required: true
type: string
enabled:
description: 'Determines whether this workflow is enabled at all (will run or skip).'
required: true
Expand All @@ -20,14 +27,6 @@ on:
description: "Usage for a scheduled job? Only then we will evaluate git refs and add them to build matrix."
required: true
type: boolean
versions:
description: 'The JSON string for versions. ( list of objects: [{NAME, VERSION[], ARCH[]}] )'
required: true
type: string
refs:
description: 'The JSON string for refs. ( object: {BRANCH, NUM_LATEST_TAGS} )'
required: true
type: string

###
### Input Secrets
Expand All @@ -46,30 +45,30 @@ on:
outputs:
# Repeat input variables
versions:
description: "Copied from inputs: The JSON string for versions."
description: "(string) Copied from inputs: The JSON string for versions."
value: ${{ jobs.configure.outputs.versions }}
refs:
description: "Copied from inputs: The JSON string for refs."
description: "(string) Copied from inputs: The JSON string for refs."
value: ${{ jobs.configure.outputs.refs }}
# Determined settings (flags)
can_login:
description: "Can we login to Dockerhub?"
description: "(boolean) Can we login to Dockerhub?"
value: ${{ jobs.configure.outputs.can_login }}
can_push:
description: "Can we push to Dockerhub?"
description: "(boolean) Can we push to Dockerhub?"
value: ${{ jobs.configure.outputs.can_push }}
has_refs:
description: "Do we have refs? (used for nightly builds)"
description: "(boolean) Do we have refs? (used for nightly builds)"
value: ${{ jobs.configure.outputs.has_refs }}
# Determined settings (values)
matrix_build:
description: "The determined build matrix"
description: "(string) The determined JSON string build matrix."
value: ${{ jobs.configure.outputs.matrix_build }}
matrix_deploy:
description: "The determined deploy matrix"
description: "(string) The determined JSON string deploy matrix."
value: ${{ jobs.configure.outputs.matrix_deploy }}
artifact_prefix:
description: "The determined unique artifact prefix"
description: "(string) The determined unique artifact prefix."
value: ${{ jobs.configure.outputs.artifact_prefix }}

jobs:
Expand Down Expand Up @@ -115,9 +114,9 @@ jobs:
shell: bash
run: |
if [ "${{ env.ENV_USER }}" = '' ] || [ "${{ env.ENV_PASS }}" = '' ]; then
echo "::set-output name=can_login::0"
echo "::set-output name=can_login::false"
else
echo "::set-output name=can_login::1"
echo "::set-output name=can_login::true"
fi
env:
ENV_USER: ${{ secrets.dockerhub_username }}
Expand All @@ -130,10 +129,10 @@ jobs:
id: set-push
shell: bash
run: |
if [ "${{ steps.set-login.outputs.can_login }}" = "1" ] && [ "${{ inputs.can_deploy }}" = "1" ]; then
echo "::set-output name=can_push::1"
if [ "${{ steps.set-login.outputs.can_login }}" = "true" ] && [ "${{ inputs.can_deploy }}" = "true" ]; then
echo "::set-output name=can_push::true"
else
echo "::set-output name=can_push::0"
echo "::set-output name=can_push::false"
fi

###
Expand All @@ -155,7 +154,7 @@ jobs:

- name: "[Set-Output] has_refs and matrix (ref-matrix) (branches and latest tags)"
id: set-refs
uses: cytopia/git-ref-matrix-action@v0.1.8
uses: cytopia/git-ref-matrix-action@v0.1.9
with:
repository_default_branch: ${{ steps.eval-refs.outputs.default_branch }}
branches: ${{ steps.eval-refs.outputs.branches }}
Expand Down Expand Up @@ -186,7 +185,7 @@ jobs:
id: set-matrix
shell: bash
run: |
if [ "${{ steps.set-refs.outputs.has_refs }}" = "1" ]; then
if [ "${{ steps.set-refs.outputs.has_refs }}" = "true" ]; then
MATRIX_BUILD="$( \
jq -M -c \
--argjson refs '${{ steps.set-refs.outputs.matrix }}' \
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/docker-multistage-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ on:
### Variables
###
inputs:
can_deploy:
description: 'Determines wheather this workflow will also deploy (login and push).'
required: true
type: boolean
matrix:
description: 'The build matrix'
required: true
type: string
has_refs:
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
flavour:
description: 'The flavour to build (Examples: base, mods, prod or work).'
required: true
type: string
artifact_prefix:
description: 'Unique artifact name prefix (to avoid overriding existing artifcats during parallel runs).'
required: true
type: string
flavour:
description: 'The flavour to build (Examples: base, mods, prod or work).'
can_deploy:
description: 'Determines wheather this workflow will also deploy (login and push).'
required: true
type: string
type: boolean
has_refs:
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
required: true
type: boolean
###
### Secrets
###
Expand Down Expand Up @@ -58,14 +58,14 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
if: inputs.has_refs == 0
if: !inputs.has_refs

- name: "[SETUP] Checkout repository (ref: ${{ matrix.refs }})"
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ matrix.refs }}
if: inputs.has_refs != 0
if: inputs.has_refs

- name: "[SETUP] Setup QEMU environment"
uses: docker/setup-qemu-action@v1
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/docker-multistage-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ on:
description: 'The build matrix'
required: true
type: string
has_refs:
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
flavour:
description: 'The flavour to build (Examples: base, mods, prod or work).'
required: true
type: string
artifact_prefix:
description: 'Unique artifact name prefix (to avoid overriding existing artifcats during parallel runs).'
required: true
type: string
flavour:
description: 'The flavour to build (Examples: base, mods, prod or work).'
has_refs:
description: 'The ref build matrix as JSON string (list of git refs to build/deploy).'
required: true
type: string
type: boolean

jobs:
# -----------------------------------------------------------------------------------------------
Expand All @@ -44,14 +44,14 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
if: inputs.has_refs == 0
if: !inputs.has_refs

- name: "[SETUP] Checkout repository (ref: ${{ matrix.refs }})"
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ matrix.refs }}
if: inputs.has_refs != 0
if: inputs.has_refs

- name: "[SETUP] Setup QEMU environment"
uses: docker/setup-qemu-action@v1
Expand Down