Skip to content

finish image vendoring #23

finish image vendoring

finish image vendoring #23

Workflow file for this run

name: CD
on:
push:
branches:
- main
tags:
- '*/v*.*.*'
jobs:
publish:
strategy:
matrix:
image: [ plural-cli, plural-bundle, plural-images-bundle ]
name: Build and push ${{ matrix.image }} image
runs-on: ubuntu-22.04
permissions:
contents: 'read'
id-token: 'write'
packages: 'write'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/pluralsh/kairos-${{ matrix.image }}
docker.io/pluralsh/kairos-${{ matrix.image }}
tags: |
type=sha
type=match,pattern=${{ matrix.image }}/v(.*),group=1
type=raw,value=latest,enable={{is_default_branch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker
uses: docker/login-action@v3
with:
username: mjgpluralsh
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push
# TODO: Do it on a job level once it will be possible.
if: ${{ startsWith(github.ref, format('refs/tags/{0}', matrix.image)) || github.ref == 'refs/heads/main' }}
uses: docker/build-push-action@v6
with:
context: "images/${{ matrix.image }}"
file: "images/${{ matrix.image }}/Dockerfile"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
GIT_COMMIT=${{ github.sha }}