Build different versions of the testenv container #3
Workflow file for this run
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: 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 GitHub Actions / Build testflinger-testenv container imageInvalid workflow file
|
||
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 }} |