Merge pull request #6589 from fidencio/topic/gha-k8s-use-ghcr-instead-of-quay

gha: Use ghcr.io for the k8s CI
This commit is contained in:
Fabiano Fidêncio 2023-04-04 10:48:16 +02:00 committed by GitHub
commit 1c6d7cb0f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 76 additions and 11 deletions

View File

@ -1,25 +1,37 @@
name: Kata Containers CI
on:
pull_request
pull_request_target:
types:
- opened
- reopened
- labeled
- synchronize
jobs:
build-kata-static-tarball-amd64:
if: contains(github.event.pull_request.labels.*.name, 'ok-to-test')
uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml
with:
tarball-suffix: -${{ github.event.pull_request.number}}-${{ github.sha }}
publish-kata-deploy-payload-amd64:
if: contains(github.event.pull_request.labels.*.name, 'ok-to-test')
needs: build-kata-static-tarball-amd64
uses: ./.github/workflows/publish-kata-deploy-payload-amd64.yaml
with:
tarball-suffix: -${{ github.event.pull_request.number}}-${{ github.sha }}
repo: kata-deploy-ci
registry: ghcr.io
repo: ${{ github.repository_owner }}/kata-deploy-ci
tag: ${{ github.event.pull_request.number }}-${{ github.sha }}-amd64
quay-io-login-continue-on-error: true
secrets: inherit
run-k8s-tests-on-aks:
if: contains(github.event.pull_request.labels.*.name, 'ok-to-test')
needs: publish-kata-deploy-payload-amd64
uses: ./.github/workflows/run-k8s-tests-on-aks.yaml
with:
image-tag: ${{ github.event.pull_request.number }}-${{ github.sha }}-amd64
registry: ghcr.io
repo: ${{ github.repository_owner }}/kata-deploy-ci
tag: ${{ github.event.pull_request.number }}-${{ github.sha }}-amd64
secrets: inherit

View File

@ -19,7 +19,8 @@ jobs:
needs: build-assets-amd64
uses: ./.github/workflows/publish-kata-deploy-payload-amd64.yaml
with:
registry: quay.io/kata-containers/kata-deploy-ci
registry: quay.io
repo: kata-containers/kata-deploy-ci
tag: kata-containers-amd64
secrets: inherit

View File

@ -5,12 +5,19 @@ on:
tarball-suffix:
required: false
type: string
registry:
required: true
type: string
repo:
required: true
type: string
tag:
required: true
type: string
quay-io-login-continue-on-error:
required: false
type: boolean
default: false
jobs:
kata-payload:
@ -29,10 +36,18 @@ jobs:
registry: quay.io
username: ${{ secrets.QUAY_DEPLOYER_USERNAME }}
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
continue-on-error: ${{ inputs.quay-io-login-continue-on-error }}
- name: Login to Kata Containers ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build-and-push-kata-payload
id: build-and-push-kata-payload
run: |
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
$(pwd)/kata-static.tar.xz \
quay.io/kata-containers/${{ inputs.repo }} ${{ inputs.tag }}
${{ inputs.registry }}/${{ inputs.repo }} ${{ inputs.tag }}

View File

@ -5,12 +5,19 @@ on:
tarball-suffix:
required: false
type: string
registry:
required: true
type: string
repo:
required: true
type: string
tag:
required: true
type: string
quay-io-login-continue-on-error:
required: false
type: boolean
default: false
jobs:
kata-payload:
@ -33,10 +40,19 @@ jobs:
registry: quay.io
username: ${{ secrets.QUAY_DEPLOYER_USERNAME }}
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
continue-on-error: ${{ inputs.quay-io-login-continue-on-error }}
- name: Login to Kata Containers ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build-and-push-kata-payload
id: build-and-push-kata-payload
run: |
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
$(pwd)/kata-static.tar.xz \
quay.io/kata-containers/$${ inputs.repo }} ${{ inputs.tag }}
${{ inputs.registry }}/${{ inputs.repo }} ${{ inputs.tag }}

View File

@ -6,11 +6,18 @@ on:
required: false
type: string
registry:
repo: true
required: true
type: string
repo:
required: true
type: string
tag:
required: true
type: string
quay-io-login-continue-on-error:
required: false
type: boolean
default: false
jobs:
kata-payload:
@ -33,10 +40,18 @@ jobs:
registry: quay.io
username: ${{ secrets.QUAY_DEPLOYER_USERNAME }}
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
continue-on-error: ${{ inputs.quay-io-login-continue-on-error }}
- name: Login to Kata Containers ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build-and-push-kata-payload
id: build-and-push-kata-payload
run: |
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
$(pwd)/kata-static.tar.xz \
quay.io/kata-containers/${{ inputs.repo }} ${{ inputs.tag }}
${{ inputs.registry }}/${{ inputs.repo }} ${{ inputs.tag }}

View File

@ -2,7 +2,13 @@ name: CI | Run kubernetes tests on AKS
on:
workflow_call:
inputs:
image-tag:
registry:
required: true
type: string
repo:
required: true
type: string
tag:
required: true
type: string
@ -52,9 +58,9 @@ jobs:
- name: Deploy kata-deploy
run: |
sed -i -e "s|quay.io/kata-containers/kata-deploy:latest|quay.io/kata-containers/kata-deploy-ci:${{ inputs.image-tag }}|g" tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml
sed -i -e "s|quay.io/kata-containers/kata-deploy:latest|${{ inputs.registry }}/${{ inputs.repo }}:${{ inputs.tag }}|g" tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml
cat tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml
cat tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml | grep "quay.io/kata-containers/kata-deploy-ci:${{ inputs.image-tag }}" || die "Failed to setup the tests image"
cat tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml | grep "${{ inputs.registry }}/${{ inputs.repo }}:${{ inputs.tag }}" || die "Failed to setup the tests image"
kubectl apply -f tools/packaging/kata-deploy/kata-rbac/base/kata-rbac.yaml
kubectl apply -f tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml