Skip to content

chore: fix type annotations #139

chore: fix type annotations

chore: fix type annotations #139

Workflow file for this run

name: container builds
on:
push:
branches:
- main
paths:
- "containers/**"
- ".github/workflows/containers.yaml"
- "python/**"
pull_request:
paths:
- "containers/**"
- ".github/workflows/containers.yaml"
- "python/**"
workflow_dispatch:
jobs:
openstack:
runs-on: ubuntu-latest
strategy:
matrix:
project: [ironic, neutron]
openstack: [2024.1]
steps:
- name: setup docker buildx
uses: docker/setup-buildx-action@v3
- name: login to ghcr.io
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/rackerlabs/understack/${{ matrix.project }}
tags: |
type=sha,enable={{is_default_branch}}
type=raw,value=${{ matrix.openstack }}-ubuntu_jammy
env:
# Create the annotations at the index as well since this
# defaults to manifest only and we have to manually merge
# the container is multi-arch because of provenance creating
# an 'unknown/unknown' arch with data. We've got no annotations
# that are arch specific so populate them at the index as well.
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
- name: build and deploy container image to registry
uses: docker/build-push-action@v5
with:
file: containers/Dockerfile.${{ matrix.project }}
build-args: OPENSTACK_VERSION=${{ matrix.openstack }}
pull: true # ensure we always have an up to date source
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
dnsmasq:
runs-on: ubuntu-latest
steps:
- name: setup docker buildx
uses: docker/setup-buildx-action@v3
- name: login to ghcr.io
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/rackerlabs/understack/dnsmasq
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,enable={{is_default_branch}}
labels: |
org.opencontainers.image.title=dnsmasq for Understack's Ironic
env:
# Create the annotations at the index as well since this
# defaults to manifest only and we have to manually merge
# the container is multi-arch because of provenance creating
# an 'unknown/unknown' arch with data. We've got no annotations
# that are arch specific so populate them at the index as well.
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
- name: build and deploy dnsmasq container to registry
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:containers"
file: Dockerfile.dnsmasq
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
workflows:
runs-on: ubuntu-latest
strategy:
matrix:
container:
- name: ironic-nautobot-client
title: Understack Ironic Nautobot Clients
steps:
- name: setup docker buildx
uses: docker/setup-buildx-action@v3
- name: login to ghcr.io
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/rackerlabs/understack/${{ matrix.container.name }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=tag
type=ref,event=pr
labels: |
org.opencontainers.image.title=${{ matrix.container.title }}
env:
# Create the annotations at the index as well since this
# defaults to manifest only and we have to manually merge
# the container is multi-arch because of provenance creating
# an 'unknown/unknown' arch with data. We've got no annotations
# that are arch specific so populate them at the index as well.
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
- name: build and deploy container image to registry
uses: docker/build-push-action@v5
with:
file: containers/Dockerfile.${{ matrix.container.name }}
pull: true # ensure we always have an up to date source
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
# prod is the target that has the code installed
target: prod