Skip to content

Build different versions of the testenv container #3

Build different versions of the testenv container

Build different versions of the testenv container #3

name: Build testflinger-testenv container image
on:
push:
branches:
- main
- testflinger-testenv
paths:
- agent/extra/testflinger-testenv/**
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:
base_version: [focal, jammy, noble]
base_image:
focal: ubuntu:focal

Check failure on line 27 in .github/workflows/build-testflinger-testenv-container.yml

View workflow run for this annotation

GitHub Actions / Build testflinger-testenv container image

Invalid workflow file

The workflow is not valid. .github/workflows/build-testflinger-testenv-container.yml (Line: 27, Col: 11): A mapping was not expected
jammy: ubuntu:jammy
noble: ubuntu: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.base_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=${{ matrix.base_image }}