【AIO】kubernetes #280
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: containerd for k8s 1.16-18 | |
on: | |
workflow_dispatch: | |
inputs: | |
sealosPatch: | |
description: 'sealos patch image for development.' | |
required: true | |
default: ghcr.io/labring/sealos-patch:latest | |
issue_comment: | |
types: | |
- created | |
env: | |
part: 0 | |
allBuild: false | |
registry: ${{ vars.D_REGISTRY_NAME }} | |
repo: ${{ vars.D_REGISTRY_REPOSITORY }} | |
sealosPatch: ${{ github.event.inputs.sealosPatch }} | |
criType: containerd | |
jobs: | |
resolve-issue-sealoslatest: | |
if: startswith(github.event.comment.body, '/kube') || startswith(github.event.comment.body, '/containerd') || startswith(github.event.comment.body, '/single_part0') || startswith(github.event.comment.body, '/single_containerd_part0') || contains(github.event.inputs.sealosPatch, 'sealos') | |
runs-on: ubuntu-20.04 | |
outputs: | |
sealoslatest: ${{ steps.set-sealoslatest.outputs.sealoslatest }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set sealos LatestVersion | |
id: set-sealoslatest | |
run: | | |
export commentbody="${{github.event.comment.body}}" | |
.github/scripts/versions/versions_sealos.sh | |
resolve-versions-arch: | |
runs-on: ubuntu-20.04 | |
needs: | |
- resolve-issue-sealoslatest | |
env: | |
sealoslatest: ${{ needs.resolve-issue-sealoslatest.outputs.sealoslatest }} | |
outputs: | |
matrix: ${{ steps.set-versions.outputs.matrix }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Resolve Versions | |
id: set-versions | |
run: .github/scripts/versions/versions_arch.sh | |
resolve-versions: | |
runs-on: ubuntu-20.04 | |
needs: | |
- resolve-issue-sealoslatest | |
env: | |
sealoslatest: ${{ needs.resolve-issue-sealoslatest.outputs.sealoslatest }} | |
outputs: | |
matrix: ${{ steps.set-versions.outputs.matrix }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Resolve Versions | |
id: set-versions | |
run: .github/scripts/versions/versions.sh | |
build-images: | |
name: building | |
needs: | |
- resolve-issue-sealoslatest | |
- resolve-versions-arch | |
runs-on: ubuntu-20.04 | |
env: | |
sealoslatest: ${{ needs.resolve-issue-sealoslatest.outputs.sealoslatest }} | |
strategy: | |
matrix: ${{ fromJson(needs.resolve-versions-arch.outputs.matrix) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download tools and sealos | |
run: .github/scripts/download.sh | |
- name: Auto build image | |
env: | |
username: ${{ vars.D_REGISTRY_REPOSITORY }} | |
password: ${{ secrets.D_REGISTRY_TOKEN }} | |
arch: ${{ matrix.arch }} | |
kubeVersion: ${{ matrix.version }} | |
run: .github/scripts/kubernetes.sh | |
build_manifest: | |
needs: | |
- resolve-issue-sealoslatest | |
- resolve-versions | |
- build-images | |
name: manifest | |
env: | |
sealoslatest: ${{ needs.resolve-issue-sealoslatest.outputs.sealoslatest }} | |
strategy: | |
matrix: ${{ fromJson(needs.resolve-versions.outputs.matrix) }} | |
runs-on: ubuntu-20.04 | |
permissions: | |
issues: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download tools and sealos | |
run: .github/scripts/download.sh | |
- name: Manifest Image | |
env: | |
username: ${{ vars.D_REGISTRY_REPOSITORY }} | |
password: ${{ secrets.D_REGISTRY_TOKEN }} | |
version: ${{ matrix.version }}-${{ env.sealoslatest }} | |
run: .github/scripts/manifest.sh | |
add-tips: | |
if: contains(github.event.comment.body, 'imagebuild') | |
needs: | |
- build_manifest | |
name: Auto add tips | |
runs-on: ubuntu-20.04 | |
permissions: | |
issues: write | |
steps: | |
- name: Success Commit | |
uses: peter-evans/create-or-update-comment@v1 | |
with: | |
issue-number: ${{ github.event.issue.number }} | |
body: | | |
🤖 says: Hooray! The action autobuild-k8s-containerd-part0 has been completed successfully. 🎉 | |
See: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |