Skip to content

Add runtime and devel build workflows (#6) #3

Add runtime and devel build workflows (#6)

Add runtime and devel build workflows (#6) #3

name: buildah-build-builder
on:
workflow_dispatch:
schedule:
- cron: '30 12 * * 0' # 12:30 UTC every Sunday
push:
paths:
- .github/workflows/buildah-build-builder.yml # Self-trigger
env:
REGISTRY: ghcr.io/bounverif
IMAGE_NAME: autoware
AUTOWARE_VERSION: latest
CONTAINERS_ROOT: /home/runner/.local/share/containers
TMPDIR: /home/runner/.local/share/containers/tmp
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: write
jobs:
autoware-builder-build:
runs-on: ubuntu-24.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 2048 # Reserve disk space for repository
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
build-mount-path: ${{ env.CONTAINERS_ROOT }} # The remaining space only for container build
- run: mkdir -p $TMPDIR
- name: Checkout repository
uses: actions/checkout@v4
- name: Set current date as the version
run: echo "AUTOWARE_VERSION=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Log in to the GitHub Container registry
uses: redhat-actions/podman-login@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build builder container image
id: build-builder
uses: redhat-actions/buildah-build@v2
with:
platforms: linux/amd64
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.AUTOWARE_VERSION }}-builder latest-builder
layers: true
oci: true
build-args: |
AUTOWARE_VERSION=${{ env.AUTOWARE_VERSION }}
extra-args:
--target autoware-builder
--cache-to=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/cache
containerfiles: |
containers/autoware-builder/Dockerfile
- name: Build builder-with-cache container image
id: build-builder-with-cache
uses: redhat-actions/buildah-build@v2
with:
platforms: linux/amd64
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.AUTOWARE_VERSION }}-builder-with-cache latest-builder-with-cache
layers: true
oci: true
build-args: |
AUTOWARE_VERSION=${{ env.AUTOWARE_VERSION }}
extra-args:
--target autoware-builder-with-cache
--cache-from=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/cache
containerfiles: |
containers/autoware-builder/Dockerfile
- name: Push to GitHub Container Repository
id: push-builder-ghcr
uses: redhat-actions/push-to-registry@v2
with:
registry: ${{ env.REGISTRY }}
image: ${{ steps.build-builder.outputs.image }}
tags: ${{ steps.build-builder.outputs.tags }}
- name: Push to GitHub Container Repository
id: push-builder-with-cache-ghcr
uses: redhat-actions/push-to-registry@v2
with:
registry: ${{ env.REGISTRY }}
image: ${{ steps.build-builder-with-cache.outputs.image }}
tags: ${{ steps.build-builder-with-cache.outputs.tags }}