constellation/.github/workflows/build-ccm-gcp-ko.yml

67 lines
2.3 KiB
YAML
Raw Normal View History

2023-01-13 18:13:29 +01:00
name: Build and Upload GCP CCM container image (KO)
2023-01-13 16:28:38 +01:00
env:
REGISTRY: ghcr.io
2023-01-13 18:13:29 +01:00
on:
workflow_dispatch:
push:
branches:
- "feat/reproducible-builds-ko-gcp"
2023-01-13 16:28:38 +01:00
jobs:
build-ccm-gcp:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
strategy:
matrix:
version: [v25.2.0, v24.0.0, v23.0.0]
include:
- version: v25.2.0
latest: true
steps:
2023-01-13 18:28:56 +01:00
- name: Check out repository
id: checkout-constellation
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ github.head_ref }}
- name: Copy action and workflows
id: copy-actions-and-workflows
run: |
2023-01-26 13:52:26 +01:00
mkdir "${GITHUB_WORKSPACE}"/constellation-actions
cp -r .github/* "${GITHUB_WORKSPACE}"/constellation-actions/
2023-01-13 18:28:56 +01:00
shell: bash
- name: Check out cloud-provider-gcp
id: checkout-cloud-provider-gcp
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
2023-01-13 16:28:38 +01:00
with:
repository: "kubernetes/cloud-provider-gcp"
ref: refs/tags/ccm/${{ matrix.version }}
2023-01-13 18:28:56 +01:00
- name: Overwrite .github folder with constellation .github
id: overwrite-actions-and-workflows
run: |
2023-01-26 13:52:26 +01:00
cp -r "${GITHUB_WORKSPACE}"/.github/* .github/
2023-01-13 18:28:56 +01:00
shell: bash
2023-01-13 16:28:38 +01:00
- 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: Build and upload ccm-gcp container image
id: build-and-upload
uses: ./.github/actions/build_micro_service_ko
with:
name: cloud-provider-gcp-ko
koTarget: ./cmd/cloud-controller-manager
githubToken: ${{ secrets.GITHUB_TOKEN }}
cosignPublicKey: ${{ startsWith(github.ref, 'refs/heads/release/v') && secrets.COSIGN_PUBLIC_KEY || secrets.COSIGN_DEV_PUBLIC_KEY }}
cosignPrivateKey: ${{ startsWith(github.ref, 'refs/heads/release/v') && secrets.COSIGN_PRIVATE_KEY || secrets.COSIGN_DEV_PRIVATE_KEY }}
cosignPassword: ${{ startsWith(github.ref, 'refs/heads/release/v') && secrets.COSIGN_PASSWORD || secrets.COSIGN_DEV_PASSWORD }}