Compile dbld-images #392
This file contains 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 | |
permissions: write-all | |
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: ubuntu-latest | |
strategy: | |
matrix: | |
image: | |
- almalinux-9 | |
- almalinux-8 | |
- fedora-39 | |
- fedora-40 | |
- fedora-41 | |
- debian-bullseye | |
- debian-bookworm | |
- debian-sid | |
- debian-testing | |
- ubuntu-focal | |
- ubuntu-jammy | |
- ubuntu-noble | |
- ubuntu-oracular | |
- devshell | |
- tarball | |
fail-fast: false | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Set container registry | |
run: | | |
CONTAINER_REGISTRY="ghcr.io/${{ github.repository_owner }}" | |
CONTAINER_REGISTRY="$(echo "$CONTAINER_REGISTRY" | tr '[:upper:]' '[:lower:]')" | |
. .github/workflows/gh-tools.sh | |
gh_export CONTAINER_REGISTRY | |
- name: Build the images | |
run: dbld/rules image-${{ matrix.image }} | |
- name: Should we upload the images? | |
run: | | |
if [ "${{ github.event.inputs.testing_image_upload }}" = "true" ] || \ | |
( \ | |
[ "${{ github.repository_owner }}" = "axoflow" ] && \ | |
[ "${{ github.ref }}" = "refs/heads/main" ] && \ | |
[[ "${{ 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@v1 | |
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 }} |