Skip to content

Container Build And Upload #123

Container Build And Upload

Container Build And Upload #123

name: Container Build And Upload
description: |
Builds and uploads to GHCR (GitHub Container Registry) the container used to build the Qualcomm debian packages.
Builds natively on an arm64 self-hosted runner. Images are uploaded on push to main, scheduled runs, and manual dispatches.
on:
schedule:
# Runs at 00:00 UTC every Monday
- cron: '0 0 * * 1'
pull_request:
branches:
- main
paths:
- '.github/workflows/qcom-container-build-and-upload.yml'
- 'Dockerfiles/**'
push:
branches:
- main
- develop
paths:
- '.github/workflows/qcom-container-build-and-upload.yml'
- 'Dockerfiles/**'
workflow_dispatch:
permissions:
contents: read
packages: write
env:
QCOM_ORG_NAME: "qualcomm-linux"
IMAGE_NAME: "pkg-builder"
jobs:
# Build the arm64 natively using a self-hosted runner on an arm64 host
# Cross compiling the image using buildx on an x86_64 host was tried but failed due to
# issues with qemu and multiarch support in docker buildx.
build-deb-arm64:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Debian Images
run: ./docker_deb_build.py --rebuild --no-update-check
- name: Log in to GHCR
if: ${{ github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Debian Images
# Only upload on trusted events that land code on main
if: ${{ github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
run: |
# UBUNTU IMAGES
docker push ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:noble
docker push ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:questing
docker push ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:resolute
# DEBIAN IMAGES
docker push ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:trixie
docker push ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:sid
build-rpm-arm64:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build RPM Images
run: ./docker_rpm_build.py --rebuild --no-update-check
- name: Log in to GHCR
if: ${{ github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Show matching images
shell: bash
run: |
docker image ls --format '{{.Repository}}:{{.Tag}}' \
| grep -E "^ghcr.io/${{ env.QCOM_ORG_NAME }}/${{ env.IMAGE_NAME }}:(fedora|rhel|redhat|centos)\..*$" || true
- name: Upload RPM Images
if: ${{ github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
shell: bash
run: |
docker image ls --format '{{.Repository}}:{{.Tag}}' \
| grep -E "^ghcr.io/${{ env.QCOM_ORG_NAME }}/${{ env.IMAGE_NAME }}:(fedora|rhel|redhat|centos)\..*$" \
| while read -r image; do
echo "Pushing $image"
docker push "$image"
done