name: Build containers on: workflow_dispatch: push: branches: ["main"] paths: ["containers/**", ".gitea/workflows/build.yaml"] pull_request: branches: ["main"] paths: ["containers/**", ".gitea/workflows/build.yaml"] schedule: - cron: "0 16 * * FRI" jobs: changes: runs-on: job-v2 outputs: any_container_change: ${{ steps.filter.outputs.containers == 'true' || steps.filter.outputs.workflow == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: https://github.com/dorny/paths-filter@v3 id: filter with: filters: | workflow: ['.gitea/workflows/build.yaml'] containers: ['containers/**'] base-image: needs: [changes] if: ${{ needs.changes.outputs.any_container_change == 'true' }} runs-on: job-v2 steps: - uses: actions/checkout@v6 - name: Log in uses: redhat-actions/podman-login@v1 with: registry: git.plabble.org username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_TOKEN }} - name: Build id: build uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef with: image: job79/base tags: ${{ github.ref_name }} context: ./containers/base containerfiles: ./containers/base/Containerfile platforms: linux/amd64 - name: Push uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build.outputs.image }} tags: ${{ steps.build.outputs.tags }} registry: git.plabble.org username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_TOKEN }} extra-args: | --compression-format=zstd --compression-level=12 dependent-images: needs: [changes, base-image] if: ${{ needs.changes.outputs.any_container_change == 'true' }} runs-on: job-v2 strategy: fail-fast: false matrix: container: [infra, go] steps: - name: Clone repo uses: actions/checkout@v6 - name: Log in uses: redhat-actions/podman-login@v1 with: registry: git.plabble.org username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_TOKEN }} - name: Build id: build uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef with: image: job79/${{ matrix.container }} tags: ${{ github.ref_name }} context: ./containers/${{ matrix.container }} containerfiles: ./containers/${{ matrix.container }}/Containerfile build-args: TAG=${{ github.ref_name }} platforms: linux/amd64 - name: Push uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build.outputs.image }} tags: ${{ steps.build.outputs.tags }} registry: git.plabble.org username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_TOKEN }} extra-args: | --compression-format=zstd --compression-level=12