ci: simplify
Build containers / changes (push) Successful in 3s
Build containers / base-image (push) Successful in 1m3s
Build containers / dependent-images (infra) (push) Successful in 9s
Build containers / dependent-images (php) (push) Successful in 57s
Build containers / dependent-images (go) (push) Failing after 1m53s
Build containers / changes (push) Successful in 3s
Build containers / base-image (push) Successful in 1m3s
Build containers / dependent-images (infra) (push) Successful in 9s
Build containers / dependent-images (php) (push) Successful in 57s
Build containers / dependent-images (go) (push) Failing after 1m53s
This commit is contained in:
+10
-22
@@ -14,11 +14,7 @@ jobs:
|
|||||||
changes:
|
changes:
|
||||||
runs-on: job-v2
|
runs-on: job-v2
|
||||||
outputs:
|
outputs:
|
||||||
base: ${{ steps.filter.outputs.base == 'true' }}
|
any_container_change: ${{ steps.filter.outputs.containers == 'true' || steps.filter.outputs.workflow == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
|
||||||
infra: ${{ steps.filter.outputs.infra == 'true' || steps.filter.outputs.base == 'true' }}
|
|
||||||
go: ${{ steps.filter.outputs.go == 'true' || steps.filter.outputs.base == 'true' }}
|
|
||||||
php: ${{ steps.filter.outputs.php == 'true' || steps.filter.outputs.base == 'true' }}
|
|
||||||
any_change: ${{ steps.filter.outputs.workflow == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'}}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
@@ -28,23 +24,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
filters: |
|
filters: |
|
||||||
workflow: ['.gitea/workflows/build.yaml']
|
workflow: ['.gitea/workflows/build.yaml']
|
||||||
base: ['containers/base/**']
|
containers: ['containers/**']
|
||||||
infra: ['containers/infra/**']
|
|
||||||
go: ['containers/go/**']
|
|
||||||
php: ['containers/php/**']
|
|
||||||
|
|
||||||
base-image:
|
base-image:
|
||||||
needs: [changes]
|
needs: [changes]
|
||||||
if: ${{ needs.changes.outputs.base == 'true' || needs.changes.outputs.any_change == 'true' }}
|
if: ${{ needs.changes.outputs.any_container_change == 'true' }}
|
||||||
runs-on: job-v2
|
runs-on: job-v2
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Log in
|
- name: Log in
|
||||||
uses: redhat-actions/podman-login@v1
|
uses: redhat-actions/podman-login@v1
|
||||||
with:
|
with:
|
||||||
registry: git.plabble.org
|
registry: git.plabble.org
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
id: build
|
id: build
|
||||||
uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef
|
uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef
|
||||||
@@ -54,6 +49,7 @@ jobs:
|
|||||||
context: ./containers/base
|
context: ./containers/base
|
||||||
containerfiles: ./containers/base/Containerfile
|
containerfiles: ./containers/base/Containerfile
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
|
|
||||||
- name: Push
|
- name: Push
|
||||||
uses: redhat-actions/push-to-registry@v2
|
uses: redhat-actions/push-to-registry@v2
|
||||||
with:
|
with:
|
||||||
@@ -68,33 +64,25 @@ jobs:
|
|||||||
|
|
||||||
dependent-images:
|
dependent-images:
|
||||||
needs: [changes, base-image]
|
needs: [changes, base-image]
|
||||||
if: always() && needs.changes.result == 'success' && (needs.base-image.result == 'success' || needs.base-image.result == 'skipped')
|
if: ${{ needs.changes.outputs.any_container_change == 'true' }}
|
||||||
runs-on: job-v2
|
runs-on: job-v2
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
container: [infra, go, php]
|
container: [infra, go, php]
|
||||||
steps:
|
steps:
|
||||||
- name: Check if build needed
|
|
||||||
id: check
|
|
||||||
run: |
|
|
||||||
if [[ "${{ matrix.container }}" == "infra" && "${{ needs.changes.outputs.infra }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
|
|
||||||
if [[ "${{ matrix.container }}" == "go" && "${{ needs.changes.outputs.go }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
|
|
||||||
if [[ "${{ matrix.container }}" == "php" && "${{ needs.changes.outputs.php }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
|
|
||||||
if [[ "${{ needs.changes.outputs.any_change }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
|
|
||||||
- name: Clone repo
|
- name: Clone repo
|
||||||
if: steps.check.outputs.run == 'true'
|
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Log in
|
- name: Log in
|
||||||
if: steps.check.outputs.run == 'true'
|
|
||||||
uses: redhat-actions/podman-login@v1
|
uses: redhat-actions/podman-login@v1
|
||||||
with:
|
with:
|
||||||
registry: git.plabble.org
|
registry: git.plabble.org
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
id: build
|
id: build
|
||||||
if: steps.check.outputs.run == 'true'
|
|
||||||
uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef
|
uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef
|
||||||
with:
|
with:
|
||||||
image: job79/${{ matrix.container }}
|
image: job79/${{ matrix.container }}
|
||||||
@@ -103,8 +91,8 @@ jobs:
|
|||||||
containerfiles: ./containers/${{ matrix.container }}/Containerfile
|
containerfiles: ./containers/${{ matrix.container }}/Containerfile
|
||||||
build-args: TAG=${{ github.ref_name }}
|
build-args: TAG=${{ github.ref_name }}
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
|
|
||||||
- name: Push
|
- name: Push
|
||||||
if: steps.check.outputs.run == 'true'
|
|
||||||
uses: redhat-actions/push-to-registry@v2
|
uses: redhat-actions/push-to-registry@v2
|
||||||
with:
|
with:
|
||||||
image: ${{ steps.build.outputs.image }}
|
image: ${{ steps.build.outputs.image }}
|
||||||
|
|||||||
Reference in New Issue
Block a user