mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
576b48c8b7
Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
75 lines
2.7 KiB
YAML
75 lines
2.7 KiB
YAML
name: Build and Upload GCP CCM container image
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
on: [workflow_dispatch]
|
|
|
|
jobs:
|
|
build-ccm-gcp:
|
|
runs-on: ubuntu-22.04
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
strategy:
|
|
matrix:
|
|
version: [v26.0.1]
|
|
# TODO(katexochen): Once issue is closed upgrade older versions, rebuild, and update versions.go
|
|
# https://github.com/kubernetes/cloud-provider-gcp/issues/451
|
|
# Alternativly, they start to publish releases themselves and we can remove this workflow (see https://github.com/kubernetes/cloud-provider-gcp/issues/289).
|
|
# version: [v26.0.1, v25.5.0, v24.0.0]
|
|
include:
|
|
- version: v26.0.1
|
|
latest: true
|
|
steps:
|
|
- name: Checkout kubernetes/cloud-provider-gcp
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
|
with:
|
|
repository: "kubernetes/cloud-provider-gcp"
|
|
ref: refs/tags/ccm/${{ matrix.version }}
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4.6.0
|
|
with:
|
|
images: |
|
|
${{ env.REGISTRY }}/edgelesssys/cloud-provider-gcp
|
|
flavor: |
|
|
latest=${{ matrix.latest || false }}
|
|
tags: |
|
|
type=semver,pattern=v{{version}},value=${{ matrix.version }}
|
|
type=semver,pattern=v{{major}}.{{minor}},value=${{ matrix.version }}
|
|
type=semver,pattern=v{{major}},value=${{ matrix.version }}
|
|
|
|
- name: Log in to the Container registry
|
|
id: docker-login
|
|
uses: ./.github/actions/container_registry_login
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build CCM
|
|
run: |
|
|
bazel build //cmd/cloud-controller-manager:cloud-controller-manager
|
|
|
|
- name: Copy CCM
|
|
run: |
|
|
# support new and old bazel output paths
|
|
cp ./bazel-bin/cmd/cloud-controller-manager/cloud-controller-manager_/cloud-controller-manager ./cloud-controller-manager || \
|
|
cp ./bazel-bin/cmd/cloud-controller-manager/linux_amd64_pure_stripped/cloud-controller-manager ./cloud-controller-manager
|
|
|
|
- name: Prepare Dockerfile
|
|
run: |
|
|
cat > Dockerfile <<EOF
|
|
FROM scratch
|
|
COPY ./cloud-controller-manager /cloud-controller-manager
|
|
EOF
|
|
|
|
- name: Build and push container image
|
|
id: build
|
|
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|