Skip to content

Commit

Permalink
Fix matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Mar 3, 2022
1 parent 927cd93 commit c411b13
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/action_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
# (2/2) Build
docker:
needs: [params]
uses: devilbox/github-actions/.github/workflows/docker-build-multi-arch.yml@v0.1.0
uses: devilbox/github-actions/.github/workflows/docker-name-version-arch.yml@master
with:
enabled: true
can_deploy: true
name: ${{ needs.params.outputs.name }}
version: ${{ needs.params.outputs.matrix_version }}
arch: ${{ needs.params.outputs.matrix_arch }}
refs: ${{ needs.params.outputs.matrix_refs }}
matrix_version: ${{ needs.params.outputs.matrix_version }}
matrix_arch: ${{ needs.params.outputs.matrix_arch }}
matrix_refs: ${{ needs.params.outputs.matrix_refs }}
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
8 changes: 4 additions & 4 deletions .github/workflows/action_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:
# (2/2) Build
docker:
needs: [params]
uses: devilbox/github-actions/.github/workflows/docker-build-multi-arch.yml@v0.1.0
uses: devilbox/github-actions/.github/workflows/docker-name-version-arch.yml@master
with:
enabled: true
can_deploy: false
name: ${{ needs.params.outputs.name }}
version: ${{ needs.params.outputs.matrix_version }}
arch: ${{ needs.params.outputs.matrix_arch }}
refs: ${{ needs.params.outputs.matrix_refs }}
matrix_version: ${{ needs.params.outputs.matrix_version }}
matrix_arch: ${{ needs.params.outputs.matrix_arch }}
matrix_refs: ${{ needs.params.outputs.matrix_refs }}
secrets:
dockerhub_username: ""
dockerhub_password: ""
8 changes: 4 additions & 4 deletions .github/workflows/action_schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:
# (2/2) Build
docker:
needs: [params]
uses: devilbox/github-actions/.github/workflows/docker-build-multi-arch.yml@v0.1.0
uses: devilbox/github-actions/.github/workflows/docker-name-version-arch.yml@master
with:
enabled: true
can_deploy: true
name: ${{ needs.params.outputs.name }}
version: ${{ needs.params.outputs.matrix_version }}
arch: ${{ needs.params.outputs.matrix_arch }}
refs: ${{ needs.params.outputs.matrix_refs }}
matrix_version: ${{ needs.params.outputs.matrix_version }}
matrix_arch: ${{ needs.params.outputs.matrix_arch }}
matrix_refs: ${{ needs.params.outputs.matrix_refs }}
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
29 changes: 13 additions & 16 deletions .github/workflows/params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@ name: params
# -------------------------------------------------------------------------------------------------
env:
NAME: PHP
#MATRIX_VERSION: '["5.2"]'
MATRIX_VERSION: >-
[
{
"NAME": "PHP",
"VERSION": "5.2"
},
{
"NAME": "PHP",
"VERSION": "5.3"
}
]
MATRIX_ARCH: >-
[
Expand Down Expand Up @@ -62,24 +57,26 @@ jobs:
steps:
- name: Test JSON
run: |
jq --argjson arches '${{ env.MATRIX_ARCH }}' 'map({NAME:.NAME,VERSION,ARCH:$arches[]})' <<<'${{ env.MATRIX_VERSION }}'
jq -M -c \
--argjson arches '${{ env.MATRIX_ARCH }}' \
'map({NAME:.NAME, VERSION, ARCH:$arches[]})' <<<'${{ env.MATRIX_VERSION }}'
- name: "Set Name"
id: set-name
run: |
echo '::set-output name=name::${{ env.NAME }}'
- name: "Set Matrix 'Version'"
- name: "[Set-Output] Matrix 'Version'"
id: set-matrix-version
run: |
echo '::set-output name=matrix::${{ env.MATRIX_VERSION }}'
echo "::set-output name=matrix::$( echo '${{ env.MATRIX_VERSION }}' | jq -M -c )"
- name: "Set Matrix 'Arch'"
- name: "[Set-Output] Matrix 'Arch'"
id: set-matrix-arch
run: |
echo '::set-output name=matrix::${{ env.MATRIX_ARCH }}'
echo "::set-output name=matrix::$( echo '${{ env.MATRIX_ARCH }}' | jq -M -c )"
- name: "Set Matrix 'Refs' (master branch and latest tag)"
- name: "[Set-Output] Matrix 'Refs' (master branch and latest tag)"
id: set-matrix-refs
uses: cytopia/[email protected]
with:
Expand All @@ -88,24 +85,24 @@ jobs:
num_latest_tags: 1
if: github.event_name == 'schedule'

- name: "Show settings'"
- name: "[DEBUG] Show settings'"
run: |
echo 'Name'
echo '--------------------'
echo ${{ steps.set-name.outputs.name }}
echo '${{ steps.set-name.outputs.name }}'
echo
echo 'Matrix: Version'
echo '--------------------'
echo ${{ steps.set-matrix-version.outputs.matrix }}
echo '${{ steps.set-matrix-version.outputs.matrix }}'
echo
echo 'Matrix: Arch'
echo '--------------------'
echo ${{ steps.set-matrix-arch.outputs.matrix }}
echo '${{ steps.set-matrix-arch.outputs.matrix }}'
echo
echo 'Matrix: Refs'
echo '--------------------'
echo ${{ steps.set-matrix-refs.outputs.matrix }}
echo '${{ steps.set-matrix-refs.outputs.matrix }}'
echo

0 comments on commit c411b13

Please sign in to comment.