Skip to content
name: Build testflinger-testenv container image
on:
push:
branches:
- main
- testflinger-testenv
paths:
- agent/extra/testflinger-testenv/**
- .github/workflows/build-testflinger-testenv-container.yml
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/testflinger-testenv
jobs:
build-testflinger-testenv:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
version: [focal, jammy, noble]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
config-inline: |
[registry."docker.io"]
mirrors = ["https://github-runner-dockerhub-cache.canonical.com:5000"]
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.version }}
- name: Build and push backend Docker image
uses: docker/build-push-action@v6
with:
context: ./agent/extra/testflinger-testenv
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BASE_IMAGE=ubuntu:${{ matrix.version }}