Skip to content

Commit

Permalink
Merge pull request kata-containers#6589 from fidencio/topic/gha-k8s-u…
Browse files Browse the repository at this point in the history
…se-ghcr-instead-of-quay

gha: Use ghcr.io for the k8s CI
  • Loading branch information
fidencio authored Apr 4, 2023
2 parents e1f972f + 3215860 commit 1c6d7cb
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 11 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/ci-on-push.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion .github/workflows/payload-after-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/publish-kata-deploy-payload-amd64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
18 changes: 17 additions & 1 deletion .github/workflows/publish-kata-deploy-payload-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
19 changes: 17 additions & 2 deletions .github/workflows/publish-kata-deploy-payload-s390x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
12 changes: 9 additions & 3 deletions .github/workflows/run-k8s-tests-on-aks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1c6d7cb

Please sign in to comment.