name: Build and Push Container Images on: push: workflow_dispatch: schedule: - cron: '0 0 * * *' # every day at midnight env: IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} REGISTRY_USER: ${{ github.actor }} REGISTRY_PASSWORD: ${{ github.token }} jobs: build-and-push: name: Build and push image runs-on: ubuntu-22.04 permissions: contents: read packages: write strategy: fail-fast: false matrix: service: - name: web-portal context: ${{ github.workspace }} dockerfile: src/web-portal/Dockerfile - name: billing-service context: ${{ github.workspace }} dockerfile: src/billing-service/Dockerfile - name: metrics-service context: ${{ github.workspace }} dockerfile: src/metrics-service/Dockerfile - name: dns-manager context: ${{ github.workspace }} dockerfile: src/dns-manager/Dockerfile steps: - name: Checkout repository uses: actions/checkout@v4 - name: Build Image id: build_image uses: redhat-actions/buildah-build@v2 with: image: container-mom-${{ matrix.service.name }} tags: | latest ${{ github.sha }} containerfiles: ${{ matrix.service.dockerfile }} context: ${{ matrix.service.context }} oci: true - name: Push To Registry uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build_image.outputs.image }} tags: ${{ steps.build_image.outputs.tags }} registry: ${{ env.IMAGE_REGISTRY }} username: ${{ env.REGISTRY_USER }} password: ${{ env.REGISTRY_PASSWORD }} extra-args: | --disable-content-trust - name: Echo outputs run: | echo "${{ toJSON(steps.push.outputs) }}"