mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
7ee8f65889
* Delete microserivce template. * Remove dependabot config * Prepare renovate by adopting GitHub actions syntax Signed-off-by: Fabian Kammel <fk@edgeless.systems>
77 lines
2.6 KiB
YAML
77 lines
2.6 KiB
YAML
name: Build and Upload GCP CCM container image
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
on: [workflow_dispatch]
|
|
|
|
# Abort runs of *this* workflow, if a new commit with the same ref is pushed.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-ccm-gcp:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
strategy:
|
|
matrix:
|
|
version: [v24.0.0, v23.0.0, v22.1.0]
|
|
include:
|
|
- version: v24.0.0
|
|
latest: true
|
|
steps:
|
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
|
|
with:
|
|
repository: "kubernetes/cloud-provider-gcp"
|
|
ref: refs/tags/ccm/${{ matrix.version }}
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@12cce9efe0d49980455aaaca9b071c0befcdd702 # tag=v4.1.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: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # tag=v2.1.0
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install bazelisk
|
|
run: |
|
|
curl -sLO "https://github.com/bazelbuild/bazelisk/releases/download/v1.12.0/bazelisk-linux-amd64"
|
|
mkdir -p "${GITHUB_WORKSPACE}/bin/"
|
|
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
|
|
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
|
|
|
|
- name: Build CCM
|
|
run: |
|
|
"${GITHUB_WORKSPACE}/bin/bazel" build //cmd/cloud-controller-manager:cloud-controller-manager
|
|
- name: Copy CCM
|
|
run: |
|
|
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@c56af957549030174b10d6867f20e78cfd7debc5 # tag=v3.2.0
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|