mirror of
https://github.com/devilbox/docker-php-fpm.git
synced 2025-12-10 11:01:14 +00:00
Unify workflows
This commit is contained in:
129
.github/workflows/action_branch.yml
vendored
129
.github/workflows/action_branch.yml
vendored
@@ -28,11 +28,12 @@ jobs:
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
configure:
|
||||
needs: [params]
|
||||
uses: ./.github/workflows/zzz-reuse-configure.yml
|
||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-configure.yml@master
|
||||
with:
|
||||
enabled: true
|
||||
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
|
||||
matrix: ${{ needs.params.outputs.matrix }}
|
||||
is_scheduled: false
|
||||
versions: ${{ needs.params.outputs.versions }}
|
||||
refs: ${{ needs.params.outputs.refs }}
|
||||
secrets:
|
||||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
@@ -44,77 +45,45 @@ jobs:
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
base:
|
||||
needs:
|
||||
- params
|
||||
- configure
|
||||
uses: ./.github/workflows/zzz-reuse-build.yml
|
||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
|
||||
with:
|
||||
enabled: true
|
||||
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
|
||||
build_matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||
has_refs: ${{ needs.configure.outputs.has_refs }}
|
||||
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||
flavour: base
|
||||
flavour_prev: ''
|
||||
run_tests: true
|
||||
secrets:
|
||||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
#base-test:
|
||||
# needs:
|
||||
# - params
|
||||
# - configure
|
||||
# - base
|
||||
# uses: ./.github/workflows/zzz-reuse-test.yml
|
||||
# with:
|
||||
# enabled: true
|
||||
# can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
|
||||
# build_matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||
# has_refs: ${{ needs.configure.outputs.has_refs }}
|
||||
# artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||
# flavour: base
|
||||
# secrets:
|
||||
# dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
# dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
upload_artifact: true
|
||||
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
# (4/8) Build & Test mods
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
mods:
|
||||
needs:
|
||||
- params
|
||||
- configure
|
||||
- base
|
||||
uses: ./.github/workflows/zzz-reuse-build.yml
|
||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
|
||||
with:
|
||||
enabled: true
|
||||
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
|
||||
build_matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||
has_refs: ${{ needs.configure.outputs.has_refs }}
|
||||
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||
flavour: mods
|
||||
flavour_prev: base
|
||||
run_tests: false
|
||||
secrets:
|
||||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
upload_artifact: true
|
||||
|
||||
mods-test:
|
||||
needs:
|
||||
- params
|
||||
- configure
|
||||
- base
|
||||
- mods
|
||||
uses: ./.github/workflows/zzz-reuse-test.yml
|
||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
|
||||
with:
|
||||
enabled: true
|
||||
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
|
||||
build_matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||
has_refs: ${{ needs.configure.outputs.has_refs }}
|
||||
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||
flavour: mods
|
||||
secrets:
|
||||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
@@ -122,44 +91,18 @@ jobs:
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
prod:
|
||||
needs:
|
||||
- params
|
||||
- configure
|
||||
- base
|
||||
- mods
|
||||
- mods-test
|
||||
uses: ./.github/workflows/zzz-reuse-build.yml
|
||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
|
||||
with:
|
||||
enabled: true
|
||||
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
|
||||
build_matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||
has_refs: ${{ needs.configure.outputs.has_refs }}
|
||||
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||
flavour: prod
|
||||
flavour_prev: mods
|
||||
run_tests: true
|
||||
secrets:
|
||||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
#prod-test:
|
||||
# needs:
|
||||
# - params
|
||||
# - configure
|
||||
# - base
|
||||
# - base-test
|
||||
# - mods
|
||||
# - mods-test
|
||||
# - prod
|
||||
# uses: ./.github/workflows/zzz-reuse-test.yml
|
||||
# with:
|
||||
# enabled: true
|
||||
# can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
|
||||
# build_matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||
# has_refs: ${{ needs.configure.outputs.has_refs }}
|
||||
# artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||
# flavour: prod
|
||||
# secrets:
|
||||
# dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
# dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
upload_artifact: true
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
@@ -167,46 +110,19 @@ jobs:
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
work:
|
||||
needs:
|
||||
- params
|
||||
- configure
|
||||
- base
|
||||
- mods
|
||||
- prod
|
||||
uses: ./.github/workflows/zzz-reuse-build.yml
|
||||
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
|
||||
with:
|
||||
enabled: true
|
||||
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
|
||||
build_matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||
matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||
has_refs: ${{ needs.configure.outputs.has_refs }}
|
||||
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||
flavour: work
|
||||
flavour_prev: prod
|
||||
run_tests: true
|
||||
secrets:
|
||||
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
#work-test:
|
||||
# needs:
|
||||
# - params
|
||||
# - configure
|
||||
# - base
|
||||
# - base-test
|
||||
# - mods
|
||||
# - mods-test
|
||||
# - prod
|
||||
# - prod-test
|
||||
# - work
|
||||
# uses: ./.github/workflows/zzz-reuse-test.yml
|
||||
# with:
|
||||
# enabled: true
|
||||
# can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
|
||||
# build_matrix: ${{ needs.configure.outputs.matrix_build }}
|
||||
# has_refs: ${{ needs.configure.outputs.has_refs }}
|
||||
# artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||
# flavour: work
|
||||
# secrets:
|
||||
# dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
# dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
upload_artifact: true
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
@@ -237,7 +153,6 @@ jobs:
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
push-manifest:
|
||||
needs:
|
||||
- params
|
||||
- configure
|
||||
- base
|
||||
- mods
|
||||
@@ -249,7 +164,7 @@ jobs:
|
||||
enabled: true
|
||||
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
|
||||
deploy_matrix: ${{ needs.configure.outputs.matrix_deploy }}
|
||||
params_matrix: ${{ needs.params.outputs.matrix }}
|
||||
params_matrix: ${{ needs.configure.outputs.versions }}
|
||||
has_refs: ${{ needs.configure.outputs.has_refs }}
|
||||
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
|
||||
secrets:
|
||||
|
||||
57
.github/workflows/params.yml
vendored
57
.github/workflows/params.yml
vendored
@@ -10,7 +10,7 @@ name: params
|
||||
# Custom Variables
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
env:
|
||||
MATRIX: >-
|
||||
VERSIONS: >-
|
||||
[
|
||||
{
|
||||
"NAME": "PHP",
|
||||
@@ -22,9 +22,16 @@ env:
|
||||
"NAME": "PHP",
|
||||
"VERSION": ["5.3", "5.4", "5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"],
|
||||
"FLAVOUR": ["default"],
|
||||
"ARCH": ["linux/amd64", "linux/arm64"]
|
||||
"ARCH": ["linux/amd64"]
|
||||
}
|
||||
]
|
||||
#"ARCH": ["linux/amd64", "linux/arm64"]
|
||||
REFS: >-
|
||||
{
|
||||
"DEFAULT_BRANCH": "master",
|
||||
"BRANCHES": "master",
|
||||
"NUM_LATEST_TAGS": 1
|
||||
}
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
@@ -32,12 +39,15 @@ env:
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
on:
|
||||
workflow_call:
|
||||
###
|
||||
### OUTPUTS
|
||||
###
|
||||
outputs:
|
||||
matrix:
|
||||
description: "The determined version matrix"
|
||||
value: ${{ jobs.params.outputs.matrix }}
|
||||
versions:
|
||||
description: "JSON string for versions. Use via: fromJson(needs.params.versions)"
|
||||
value: ${{ jobs.params.outputs.versions }}
|
||||
refs:
|
||||
description: "The determined git ref matrix (only during scheduled run)"
|
||||
description: "JSON string for refs. Use via: fromJson(needs.params.refs)"
|
||||
value: ${{ jobs.params.outputs.refs }}
|
||||
|
||||
jobs:
|
||||
@@ -45,37 +55,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
refs: ${{ steps.set-refs.outputs.matrix }}
|
||||
versions: ${{ steps.set-versions.outputs.versions }}
|
||||
refs: ${{ steps.set-refs.outputs.refs }}
|
||||
|
||||
steps:
|
||||
- name: "[Set-Output] Matrix"
|
||||
id: set-matrix
|
||||
- name: "[Set-Output] jsonify VERSIONS"
|
||||
id: set-versions
|
||||
run: |
|
||||
echo "::set-output name=matrix::$( echo '${{ env.MATRIX }}' | jq -M -c )"
|
||||
echo "::set-output name=versions::$( echo '${{ env.VERSIONS }}' | jq -M -c )"
|
||||
|
||||
- name: "[Set-Output] Matrix 'Refs' (master branch and latest tag)"
|
||||
- name: "[Set-Output] jsonify REFS"
|
||||
id: set-refs
|
||||
uses: cytopia/git-ref-matrix-action@v0.1.4
|
||||
with:
|
||||
repository_default_branch: master
|
||||
branches: master
|
||||
num_latest_tags: 1
|
||||
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
|
||||
|
||||
- name: "[DEBUG] Show settings'"
|
||||
run: |
|
||||
echo 'Matrix'
|
||||
echo '--------------------'
|
||||
echo '${{ steps.set-matrix.outputs.matrix }}'
|
||||
echo
|
||||
|
||||
echo 'Matrix: Refs'
|
||||
echo '--------------------'
|
||||
echo '${{ steps.set-matrix-refs.outputs.matrix }}'
|
||||
echo
|
||||
|
||||
echo 'GitHub event_name'
|
||||
echo '--------------------'
|
||||
echo '${{ github.event_name }}'
|
||||
echo
|
||||
echo "::set-output name=refs::$( echo '${{ env.REFS }}' | jq -M -c )"
|
||||
|
||||
Reference in New Issue
Block a user