Merge pull request #172 from rackerlabs/fix-ironic-vendor #77
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: container builds | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "containers/**" | |
- ".github/workflows/containers.yaml" | |
pull_request: | |
paths: | |
- "containers/**" | |
- ".github/workflows/containers.yaml" | |
workflow_dispatch: | |
jobs: | |
openstack: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
project: [ironic] | |
openstack: [2023.1, 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/openstackhelm/${{ matrix.project }} | |
tags: | | |
type=sha,enable={{is_default_branch}} | |
type=raw,value=${{ matrix.openstack }}-ubuntu_jammy | |
- name: build and deploy container image to registry | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}:containers" | |
file: 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: dnsmasq image metadata | |
id: dnsmasq-meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/rackerlabs/openstackhelm/dnsmasq | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=sha,enable={{is_default_branch}} | |
labels: | | |
org.opencontainers.image.title=dnsmasq for Ironic deployed as openstack-helm | |
- 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.dnsmasq-meta.outputs.tags }} | |
labels: ${{ steps.dnsmasq-meta.outputs.labels }} |