Compile dbld-images #532
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Compile dbld-images | |
| on: | |
| pull_request: | |
| paths: | |
| - 'dbld/**' | |
| - 'packaging/rhel/**' | |
| - 'packaging/debian/**' | |
| - '.github/workflows/dbld-images.yml' | |
| push: | |
| paths: | |
| - 'dbld/**' | |
| - 'packaging/rhel/**' | |
| - 'packaging/debian/**' | |
| - '.github/workflows/dbld-images.yml' | |
| schedule: | |
| - cron: '00 22 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| testing_image_upload: | |
| description: Should we upload the images into GitHub Packages? (true/false) | |
| required: false | |
| default: "false" | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.platform }} | |
| strategy: | |
| matrix: | |
| image: | |
| - almalinux-8 | |
| - almalinux-9 | |
| - centos-stream9 | |
| - fedora-latest | |
| - fedora-rawhide | |
| - debian-bullseye | |
| - debian-bookworm | |
| #- debian-sid - curently this is broken again | |
| - debian-testing | |
| - ubuntu-focal | |
| - ubuntu-jammy | |
| - ubuntu-noble | |
| - devshell | |
| - kira | |
| - tarball | |
| arch: | |
| - amd64 | |
| platform: | |
| # FIXME: temporary because sudo doesn't work in RedHat and descendants on an ubuntu-24.04 hosts (ubuntu-latest) | |
| - ubuntu-22.04 | |
| - ubuntu-22.04-arm | |
| exclude: | |
| - platform: ubuntu-22.04-arm | |
| include: | |
| - image: debian-bookworm | |
| platform: ubuntu-22.04-arm | |
| arch: arm64 | |
| - image: devshell | |
| platform: ubuntu-22.04-arm | |
| arch: arm64 | |
| fail-fast: false | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Set container ENV | |
| run: | | |
| CONTAINER_REGISTRY="ghcr.io/${{ github.repository_owner }}" | |
| CONTAINER_REGISTRY="$(echo "$CONTAINER_REGISTRY" | tr '[:upper:]' '[:lower:]')" | |
| CONTAINER_ARCH=${{ matrix.arch }} | |
| CONTAINER_NAME_SUFFIX="$([ ${{ matrix.arch }} = amd64 ] && echo '' || echo '-arm64')" | |
| . .github/workflows/gh-tools.sh | |
| gh_export CONTAINER_REGISTRY CONTAINER_ARCH CONTAINER_NAME_SUFFIX | |
| - name: Build the images | |
| run: dbld/rules image-${{ matrix.image }}${CONTAINER_NAME_SUFFIX} | |
| - name: Should we upload the images? | |
| run: | | |
| if [ "${{ github.event.inputs.testing_image_upload }}" = "true" ] || \ | |
| ( \ | |
| [ "${{ github.repository_owner }}" = "syslog-ng" ] && \ | |
| [ "${{ github.ref }}" = "refs/heads/master" ] && \ | |
| [[ "${{ github.event_name }}" =~ ^(push|workflow_dispatch|schedule)$ ]] \ | |
| ) | |
| then | |
| UPLOAD_IMAGES_INTERNAL="true" | |
| else | |
| UPLOAD_IMAGES_INTERNAL="false" | |
| fi | |
| . .github/workflows/gh-tools.sh | |
| gh_export UPLOAD_IMAGES_INTERNAL | |
| - name: Log in to the Container registry | |
| if: env.UPLOAD_IMAGES_INTERNAL == 'true' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push the images | |
| if: env.UPLOAD_IMAGES_INTERNAL == 'true' | |
| run: | | |
| dbld/rules push-image-${{ matrix.image }}${CONTAINER_NAME_SUFFIX} |