test build #1
This file contains hidden or 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: Build | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| tags: | ||
| type: string | ||
| description: The Docker Tags (see docker/metadata-action@v4 for available values) | ||
| required: true | ||
| jobs: | ||
| skopeo: | ||
| name: kubectl_versions | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| kubectl_versions: ${{ steps.kubectl_versions.ouputs.kubectl_versions }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
| - name: 'Set up skopeo' | ||
| uses: warjiang/setup-skopeo@main | ||
| with: | ||
| version: latest | ||
| - name: 'versions' | ||
| id: kubectl_versions | ||
| run: | | ||
| python --version | ||
| export ALL_VERSIONS=$(skopeo list-tags docker://registry.k8s.io/kubectl | jq -r '.Tags | .[]| select(. | match("v[0-9].[0-9]{2}.[0-9]$"))') | ||
| export VERSIONS=$(python ./get_kubectl_versions.py) | ||
| echo ${VERSIONS} | ||
| echo "kubectl_versions=${VERSIONS}" >> $GITHUB_OUTPUT | ||
| build-kubectl: | ||
| runs-on: ubuntu-latest | ||
| needs: ["kubectl_versions"] | ||
| strategy: | ||
| matrix: | ||
| version: ${{ needs.kubectl_versions.outputs.kubectl_versions }} | ||
| steps: | ||
| - name: Build-kubetcl-with-shell | ||
| uses: coopTilleuls/action-docker-build-push@custom-tags | ||
| with: | ||
| IMAGE_NAME: kubectl | ||
| BUILD_CONTEXT: ./kubectl | ||
| BUILD_ARGS: ${{ matrix.version }} | ||
| BUILD_TARGET: debian-kubectl | ||
| REGISTRY_JSON_KEY: ${{ secrets.GITHUB_TOKEN }} | ||
| IMAGE_REPOSITORY: ghcr.io/cooptilleuls/sre | ||
| CUSTOM_TAG: ${{ matrix.version }} | ||